Part Number Hot Search : 
B800033 LF50AB AN2514S ZMM5230B SBC84622 LCX009AK GM431B G402SD
Product Description
Full Text Search
 

To Download MC705C9ACPE Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  m68hc05 microcontrollers freescale.com mc68hc705c9a advance information data sheet mc68hc705c9a rev. 4.1 9/2005 this document contains certain information on a new product.spec ifications and information herein are subject to change without notice.
blank
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 3 mc68hc705c9a advance information data sheet to provide the most up-to-date information, the revisi on of our documents on the world wide web will be the most current. your printed copy may be an earlier revision. to verify you have the latest information available, refer to: http://www.freescale.com/ the following revision history table summarizes changes contained in this document. for your convenience, the page number designators have been linked to the appropriate location. revision history date revision level description page number(s) october, 2001 3.0 format update to current publication standards n/a figure 12-10. spi slave timing diagram ? corrected labels for miso and mosi and subtitle for part b. 145 february, 2002 4.0 figure 8-3. timer status register (tsr) ? corrected address designator from $0012 to $0013. 78 september, 2005 4.1 updated to meet freescale identity guidelines. throughout
revision history mc68hc05c9a advance informati on data sheet, rev. 4.1 4 freescale semiconductor
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 5 list of chapters chapter 1 general descr iption. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 chapter 2 memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 chapter 3 central processor unit (cpu). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 chapter 4 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 chapter 5 resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 chapter 6 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 chapter 7 input/output (i/o) port s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 chapter 8 capture/compare timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 chapter 9 serial communications interf ace (sci) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 chapter 10 serial peripheral interface (spi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 chapter 11 instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 chapter 12 electrical spec ifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 chapter 13 mechanical specificati ons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 chapter 14 ordering information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 appendix a eprom programmi ng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 appendix b m68hc05cx family feature comparisons . . . . . . . . . . . . . . . . . . . . . . . . . . 115
list of chapters mc68hc05c9a advance informati on data sheet, rev. 4.1 6 freescale semiconductor
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 7 table of contents chapter 1 general description 1.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.2 features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.3 configuration options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 1.4 mask options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 1.4.1 port b mask option register (pbmor) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 1.4.2 c12 mask option register (c12mor). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 1.5 software-programmable options (mc6 8hc05c9a mode only) . . . . . . . . . . . . . . . . . . . . . . . . 18 1.6 functional pin descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 1.6.1 v dd and v ss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.6.2 v pp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.6.3 irq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.6.4 osc1 andosc2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.6.5 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.6.6 tcap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.6.7 tcmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.6.8 pa0?pa7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.6.9 pb0?pb7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.6.10 pc0?pc7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.6.11 pd0?pd5 and pd7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 chapter 2 memory 2.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2.2 ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2.3 eprom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2.4 eprom security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 2.5 rom. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 2.6 i/o registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 chapter 3 central processor unit (cpu) 3.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 3.2 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 3.2.1 accumulator (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.2.2 index register (x) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.2.3 program counter (pc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.2.4 stack pointer (sp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.2.5 condition code register (ccr). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 4
table of contents mc68hc05c9a advance informati on data sheet, rev. 4.1 8 freescale semiconductor chapter 4 interrupts 4.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 4.2 non-maskable software interrupt (swi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 4.3 external interrupt (irq or port b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 4.4 timer interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 4.5 sci interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 4.6 spi interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 chapter 5 resets 5.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 5.2 power-on reset (por) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 5.3 reset pin. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 5.4 computer operating properly (cop) reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 5.5 mc68hc05c9a compatible cop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 5.5.1 c9a cop reset register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 5.5.2 c9a cop control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 5.6 mc68hc05c12a compatible cop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 5.7 mc68hc05c12a compatible cop clear register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 5.8 cop during wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 5.9 cop during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 5.9.1 clock monitor reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 5.9.2 stop instruction disable option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4 chapter 6 low-power modes 6.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 6.2 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 6.3 wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 chapter 7 input/output (i/o) ports 7.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 7.2 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 7.3 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 7.4 port c. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 7.5 port d. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 chapter 8 capture/compare timer 8.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 8.2 timer operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 8.2.1 input capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 8.2.2 output compare. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
table of contents mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 9 8.3 timer i/o registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 8.3.1 timer control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 8.3.2 timer status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 8.3.3 timer registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 8.3.4 alternate timer registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 8.3.5 input capture registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 8.3.6 output compare registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 8.4 timer during wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 8.5 timer during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 chapter 9 serial communications interface (sci) 9.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 9.2 features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 9.3 sci receiver features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 9.4 sci transmitter features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 9.5 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 9.6 data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 9.7 receiver wakeup operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 9.8 idle line wakeup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 9.9 address mark wakeup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 9.10 receive data in (rdi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 9.11 start bit detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 9.12 transmit data out (tdo). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 9.13 sci i/o registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 9.13.1 sci data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 9.13.2 sci control register 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 9.13.3 sci control register 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 9.13.4 sci status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 9.13.5 baud rate register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 chapter 10 serial peripheral interface (spi) 10.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 10.2 features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 10.3 spi signal description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 10.3.1 master in slave out (miso). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 10.3.2 master out slave in (mosi). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 10.3.3 serial clock (sck) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 10.3.4 slave select (ss ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 10.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 10.5 spi registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 10.5.1 serial peripheral control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 10.5.2 serial peripheral status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 10.5.3 serial peripheral data i/o register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
table of contents mc68hc05c9a advance informati on data sheet, rev. 4.1 10 freescale semiconductor chapter 11 instruction set 11.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 11.2 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 11.2.1 inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 11.2.2 immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 11.2.3 direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 11.2.4 extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 11.2.5 indexed, no offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 11.2.6 indexed, 8-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 11.2.7 indexed, 16-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 11.2.8 relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 11.3 instruction types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 11.3.1 register/memory instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 11.3.2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 11.3.3 jump/branch instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 11.3.4 bit manipulation instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 11.3.5 control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 11.4 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 11.5 opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 chapter 12 electrical specifications 12.1 maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 12.2 operating temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 12.3 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 12.4 power considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 12.5 5.0-vdc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 12.6 3.3-vdc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 12.7 5.0-vdc control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 12.8 3.3-vdc control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 12.9 5.0-vdc serial peripheral interface timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2 12.10 3.3- vdc serial peirpheral interface timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 03 chapter 13 mechanical specifications 13.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 13.2 40-pin plastic dual in-line (dip) package (case 711-03) . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 13.3 42-pin plastic shrink dual in-line (sdip) package (c ase 858-01). . . . . . . . . . . . . . . . . . . . . 108 13.4 44-lead plastic leaded chip carrier (plcc) (case 777-02) . . . . . . . . . . . . . . . . . . . . . . . . . 109 13.5 44-lead quad flat pack (qfp) (case 824a-01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
table of contents mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 11 chapter 14 ordering information 14.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 14.2 mc order numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 appendix a eprom programming a.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 a.2 bootloader mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 a.3 bootloader functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 a.4 programming register (prog) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 14 appendix b m68hc05cx family feature comparisons
table of contents mc68hc05c9a advance informati on data sheet, rev. 4.1 12 freescale semiconductor
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 13 chapter 1 general description 1.1 introduction the mc68hc705c9a hcmos microcomputer is a member of the m68hc05 family. the mc68hc705c9a is the eprom version of the mc68 hc05c9a and also can be configured as the eprom version of the mc68hc05c12a. the mc68hc7 05c9a memory map consists of 12,092 bytes of user eprom and 176 bytes of ram when it is co nfigured as an mc68hc05c12a and 15,932 bytes of user eprom and 352 bytes of ram when configur ed as an mc68hc05c9a. the mc68hc705c9a includes a serial communications interface, a seri al peripheral interface, and a 16-bit capture/compare timer. 1.2 features features include:  programmable mask option register (mor) for c9a/c12a configuration  programmable mor for port b pullups and interrupts  popular m68hc05 central processor unit (cpu)  15,932 bytes of eprom (12,092 bytes for c12a configuration)  352 bytes of ram (176 for c12a configuration)  memory mapped input/output (i/o)  31 bidirectional i/o lines (24 i/o + 6 input only fo r c12a configuration) with high current sink and source on pc7  asynchronous serial communications interface (sci)  synchronous serial peripheral interface (spi)  16-bit capture/compare timer  computer operating properly (cop ) watchdog timer and clock monitor  power-saving wait and stop modes  on-chip crystal oscillator connections  single 3.0 volts to 5.5 volts power supply requirement  eprom contents security (1) feature 1. no security feature is absolutely secu re. however, freescale?s strategy is to ma ke reading or copying the eprom difficult fo r unauthorized users.
general description mc68hc05c9a advance informati on data sheet, rev. 4.1 14 freescale semiconductor figure 1-1. block diagram 0 000 001 1 cpu control arithmetic/logic unit accumulator index register stack pointer program counter m68hc05 mcu reset condition code register 111hi ncz data direction register a port a pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 cop internal oscillator divide by two capture/ irq v dd v ss osc1 osc2 user ram ?352 bytes reset data direction register b port b pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 data direction register c port c user eprom ? 15,936 bytes pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 compare timer tcmp tcap watchdog cpu clock power internal clock pullup enable register b spi generator baud rate sci ss sck mosi miso tdo rdi data direction register d port d pd7 pd5/ss pd4/sck pd3/mosi pd2/miso pd1/tdo pd0/rdi divide by four timer clock boot rom ? 239 bytes
configuration options mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 15 1.3 configuration options the options and functions of the mc68hc705c9a can be configured to emulate either the mc68hc05c9a or the mc68hc05c12a. the rom device mc68hc05c9a has eight rom mask opti ons to select external interrupt/internal pullup capability on each of the eight port b bits. other opt ional features are controlled by software addressable registers during operation of the microcontroller. t hese features are irq sensitivity and memory map configuration. on the rom device mc68hc05c12a, all optional feat ures are controlled by rom mask options. these features are the eight port b interrupt/pullup options, irq sensitivity, stop instruction disable, and cop enable. on the mc68hc705c9a the rom mask options of the mc68hc05c9a and the mc68hc05c12a are controlled by mask option registers (mors). the mors are eprom registers which must be programmed appropriately prior to operation of the microcontroller. the software options of the mc68hc05c9a are implemented by identical software registers in the mc68hc705c9a. when configured as an mc68hc05c9a:  the entire 16k memory map of the c9a is enabled, including dual-mapped ram and eprom at locations $0020?$004f and $0100?$017f.  c12a options in the c12mor ($3ff1) are disabled.  the c9a option register ($3fdf) is enabled, allo wing software control over the irq sensitivity and the memory map configuration.  the c9a cop reset register ($001d) and the c9a cop control register ($001e) are enabled, allowing software control over the c9a cop and clock monitor.  the c12 cop clear register ($3ff0) is disabled.  the port d data direction register ($0007) is enabled, allowing output capability on the seven port d pins.  spi output signals (mosi, miso, and sck) require the corresponding bits in the port d data direction register to be set for output.  the port d wire-or mode control bit (bit 5 of spcr $000a) is enabled, allowing open-drain configuration of port d.  the reset pin becomes bidirectional; this pin is driven low by a c9a cop or clock monitor timeout or during power-on reset. when configured as an mc68hc05c12a:  memory locations $0100?$0fff are disabled, cr eating a memory map identical to the mc68hc05c12a.  c12a options in the c12mor ($3ff1) are enabled; these bits control irq sensitivity, stop instruction disable and c12 cop enable.  the c9a option register ($3fdf) is disabled, preventing software control over the irq sensitivity and the memory map configuration.  the c9a cop reset register ($001d) and the c9a cop control register ($001e) are disabled, preventing software control over the c9a cop and clock monitor.  the c12 cop clear register ($3ff0) is enabled; this write-only register is used to clear the c12 cop.
general description mc68hc05c9a advance informati on data sheet, rev. 4.1 16 freescale semiconductor  the port d data direction register ($0007) is disabled and the seven port d pins become input only.  spi output signals (mosi, miso, and sck) do not require the data direction register control for output capability.  the port d wire-or mode control bit (bit 5 of spcr $000a) is disabled, preventing open-drain configuration of port d.  the reset pin becomes input only. 1.4 mask options the following two mask option registers are used to select features controlled by mask changes on the mc68hc05c9a and the mc68hc05c12a:  port b mask option register (pbmor)  c12 mask option register (c12mor) the mask option registers are eprom locations which must be programmed prior to operation of the microcontroller. 1.4.1 port b mask op tion register (pbmor) the pbmor register, shown in figure 1-2 , contains eight programmable bits which determine whether each port b bit (when in input mode) has the pullup and interrupt enabled. the port b interrupts share the vector and edge/edge-level sensitivity with the irq pin. for more details, (see 4.3 external interrupt (irq or port b) ). pbpu7?pbpu0 ? port b pullup/interrupt enable bits 1 = pullup and cpu interrupt enabled 0 = pullup and cpu interrupt disabled note the current capability of the port b pullup devices is equivalent to the mc68hc05c9a, which is less than the mc68hc05c12a. 1.4.2 c12 mask opti on register (c12mor) the c12mor register, shown in figure 1-3 , controls the following options:  select between mc68hc05c9a/c12a configuration  enable/disable stop mode (c12a mode only)  enable/disable cop (c12a mode only)  edge-triggered only or edge- and level-triggered external interrupt pin (irq pin) (c12a mode only). $3ff0bit 7654321bit 0 pbpu7 pbpu6 pbpu5 pbpu4 pbpu3 pbpu2 pbpu1 pbpu0 figure 1-2. port b mask option register
mask options mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 17 c12a ? c12a/c9a mode select bit this read/write bit selects between c12a configuration and c9a configuration. 1 = configured to emulate mc68hc05c12a 0 = configured to emulate mc68hc05c9a c12irq ? c12a interrupt request bit this read/write bit selects between an edge-triggered only or edge- and level-triggered external interrupt pin. if configured in c9a mode, this bit has no effect and will be forced to 0 regardless of the programmed state. 1 = edge and level interrupt option selected 0 = edge-only interrupt option selected note any port b pin configured for interrupt capability will follow the same edge or edge/level trigger as the irq pin. stopdis ? stop instruction disable bit this read-only bit allows emulation of the ?sto p disable? mask option on the mc68hc05c12a. (see 5.9 cop during stop mode .) if configured in mc68hc05c9a mode, this bit has no effect and will be forced to 0 regardless of the programmed state. 1 = if the mcu enters stop mode, the clock monitor is enabled to force a system reset 0 = stop instruction executed as normal c12cope ? c12a cop enable bit this read-only bit enables the cop function when configured in mc68hc05c 12a mode. if configured in mc68hc05c9a mode, this bit has no effect and will be forced to 0 regardless of the programmed state. 1 = when in c12a mode, this enables the c12acop watchdog timer. 0 = when in c12a mode, this dis ables the c12acop watchdog timer. sec ? security enable bit this read-only bit enables the eprom security feature. once programmed, this bit helps to prevent external access to the programmed eprom data. the eprom data cannot be verified or modified. 1 = security enabled 0 = security disabled note during power-on reset, the device always will be configured as mc68hc05c9a regardless of the state of the c12a bit. $3ff1 bit 7 6 5 4 3 2 1 bit 0 read: sec c12cope stopdis c12irq c12a write: = unimplemented figure 1-3. mask option register 2
general description mc68hc05c9a advance informati on data sheet, rev. 4.1 18 freescale semiconductor 1.5 software-programmable options (mc68hc05c9a mode only) the c9a option register (or), shown in figure 1-4 , is enabled only if configured in c9a mode. this register contains the programmabl e bits for the following options:  map two different areas of memory between ram and eprom, one of 48 bytes and one of 128 bytes  edge-triggered only or edge- and level-triggered external interrupt (irq pin and any port b pin configured for interrupt) this register must be written to by user software during operation of the microcontroller. ram0 ? random access memory control bit 0 this read/write bit selects between ram or eprom in location $0020 to $004f. this bit can be read or written at any time. 1 = ram selected 0 = eprom selected ram1? random access memory control bit 1 this read/write bit selects between ram or eprom in location $0100 to $017f. this bit can be read or written at any time. 1 = ram selected 0 = eprom selected irq ? interrupt request bit this bit selects between an edge-triggered only or edge- and level- triggered external interrupt pin. this bit is set by reset, but can be cleared by software. this bit can be written only once. 1 = edge and level interrupt option selected 0 = edge-only interrupt option selected $3fdfbit 7654321bit 0 read: ram0 ram1 irq write: reset:00000010 = unimplemented figure 1-4. c9a option register
functional pin descriptions mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 19 1.6 functional pin descriptions figure 1-5 , figure 1-6 , figure 1-7 , and figure 1-8 show the pin assignments for the available packages. a functional description of the pins follows. note a line over a signal name indicates an active low signal. for example, reset is active high and reset is active low. figure 1-5. 40-pin pdip pin assignments 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 pd0/rdi pd1/tdo pd2/miso pd3/mosi pd4/sck pd5/ss tcmp pd7 tcap osc2 osc1 v dd v ss pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 pa0 pa1 pa2 pa3 pa4 pa5 pa6 pa7 v pp irq reset
general description mc68hc05c9a advance informati on data sheet, rev. 4.1 20 freescale semiconductor figure 1-6. 42-pin sdip pin assignments 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 pc6 pc5 pc4 pc3 n/c pc2 pc1 pc0 pd0/rdi pd1/tdo pd2/miso pd3/mosi pd4/sck pd5/ss tcmp pd7 tcap osc2 osc1 v dd pb7 pb6 pb5 pb4 n/c pb3 pb2 pb1 pb0 pa0 pa1 pa2 pa3 pa4 pa5 pa6 pa7 v pp irq reset 21 22 pc7 v ss
functional pin descriptions mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 21 figure 1-7. 44-lead plcc pin assignments note the above 44-pin plcc pin assignment diagram is for compatibility with mc68hc05c9a. to allow compat ibility with the 44-pin plcc mc68hc05c12a, pin17 and pin18 must be tied together and pin 39 and pin 40 also must be tied together. to allow compatibility with mc68hc705c8a, pin 3 and pin 4 also should be tied together. 39 38 37 36 35 34 33 32 31 30 29 pc2 pc1 pc0 pd0/rdi pd1/tdo pd2miso pd3/mosi pd4/sck pd5/ss tcmp n/c 7 8 9 10 11 12 13 14 15 16 17 28 27 26 25 24 23 22 21 20 19 18 6 5 4 3 2 44 43 42 41 40 1 pd7 pc4 pc5 pc6 pc7 n/c v ss pb7 pb6 pb5 pb4 tcap osc2 osc1 v dd reset irq v pp n/c pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 pb0 pb1 pb2 pb3 n/c pc3
general description mc68hc05c9a advance informati on data sheet, rev. 4.1 22 freescale semiconductor figure 1-8. 44-pin qfp pin assignments 1.6.1 v dd and v ss power is supplied to the mc u using these two pins. v dd is the positive supply and v ss is ground. 1.6.2 v pp this pin provides the programming voltage to the eprom array. for normal operation, v pp should be tied to v dd . 1.6.3 irq this interrupt pin has an option that provides two different choices of interrupt triggering sensitivity. the irq pin contains an internal schmitt trigger as part of its input to improve noise immunity. refer to chapter 4 interrupts for more detail. 1.6.4 osc1 andosc2 these pins provide control input for an on-chip clock oscillator circuit. a crysta l connected to these pins provides a system clock. the internal frequency is one-half the crystal frequency. 33 32 31 30 29 28 27 26 25 24 23 pc3 pc2 pc1 pc0 pd0/rdi pd1/tdo pd2/miso pd3/mosi pd4/sck pd5/ss tcmp 1 2 3 4 5 6 7 8 9 10 11 22 21 20 19 18 17 16 15 14 13 12 44 43 42 41 40 38 37 36 35 34 pd7 pc4 pc5 pc6 pc7 v ss n/c pb7 pb6 pb5 pb4 tcap osc2 osc1 v dd n/c n/c reset irq v pp pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 pb0 pb1 pb2 pb3 39 n/c
functional pin descriptions mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 23 1.6.5 reset as an input pin, this active low reset pin is used to reset the mcu to a known startup state by pulling reset low. as an output pin, when in mc68hc05c9a mode only, the reset pin indicates that an internal mcu reset has occurred. the reset pin contains an internal schm itt trigger as part of its input to improve noise immunity. refer to chapter 5 resets for more detail. 1.6.6 tcap this pin controls the input capture feature for the on-chip programmable timer. the tcap pin contains an internal schmitt trigger as part of its input to improve noise immunity. refer to chapter 8 capture/compare timer for more detail. 1.6.7 tcmp the tcmp pin provides an output for the output com pare feature of the on-chip programmable timer. refer to chapter 8 capture/compare timer for more detail. 1.6.8 pa0?pa7 these eight i/o lines comprise port a. the state of each pin is software programmable and all port a pins are configured as inputs during reset. refer to chapter 7 input/output (i/o) ports for more detail. 1.6.9 pb0?pb7 these eight i/o lines comprise port b. the state of each pin is software programmable and all port b pins are configured as inputs during reset. port b has mask option register enabled pullup devices and interrupt capability selectable for any pin. refer to chapter 7 input/output (i/o) ports for more detail. 1.6.10 pc0?pc7 these eight i/o lines comprise port c. the state of each pin is software programmable and all port c pins are configured as inputs during reset. pc7 has high current sink and source capability. refer to chapter 7 input/output (i/o) ports for more detail. 1.6.11 pd0?pd5 and pd7 these seven i/o lines comprise port d. when configured as a c9a the state of each pin is software programmable and all port d pins are configured as inputs during reset. when configured as a c12a, the port d pins are input only. refer to chapter 7 input/output (i/o) ports for more detail.
general description mc68hc05c9a advance informati on data sheet, rev. 4.1 24 freescale semiconductor
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 25 chapter 2 memory 2.1 introduction the mcu has a 16-kbyte memory map when co nfigured as either an mc68hc05c9a or an mc68hc05c12a. the memory map consists of register s (i/o, control, and status), user ram, user eprom, bootloader rom, and reset and interrupt vectors as shown in figure 2-1 and figure 2-2 . when configured as an mc68hc05c9a, two control bits in the option register ($3fdf) allow the user to switch between ram and eprom at any time in two special areas of the memory map, $0020-$004f (48 bytes) and $0100-$017f (128 bytes). when configur ed as an mc68hc05c12a, the section of the memory map from $0020 to $004f is fixed as eprom and the section from $0100 to $0fff becomes unused. 2.2 ram the main user ram consists of 176 bytes at $005 0?$00ff. this ram area is always present in the memory map and includes a 64-byte stack area. the stack pointer can access 64 bytes of ram in the range $00ff down to $00c0. note using the stack area for data storage or temporary work locations requires care to prevent it from being overwritten due to stacking from an interrupt or subroutine call. in mc68hc05c9a configuration, two additional ra m areas are available at $0020?$004f (48 bytes) and $0100?$017f (128 bytes) (see figure 2-1 and figure 2-2 .) these may be accessed at any time by setting the ram0 and ram1 bits, respectively, in the c9a option register. refer to 1.5 software-programmable options (mc68hc05c9a mode only) for additional information. 2.3 eprom when configured as a c12a the main user eprom c onsists of 48 bytes of page zero eprom from $0020 to $004f, 12,032 bytes of eprom from $1000 to $3eff, and 14 bytes of user vectors from $3ff4 to $3fff. when configured as a c9a, an additional 3,840 bytes of user eprom from $0100 to $0fff are enabled. locations $3ff0 and $3ff1 are the mask option registers (mor) (see 1.4 mask options ). for detailed information on programming the eprom see appendix a eprom programming .
memory mc68hc05c9a advance informati on data sheet, rev. 4.1 26 freescale semiconductor figure 2-1. c9a memory map port a data register port b data register port c data register port d data register port a data direction register port b data direction register port c data direction register port d data direction register unused unused spi control register spi status register spi data register sci baud rate register sci control register 1 sci control register 2 sci status register sci data register timer control register timer status register input capture register (high) port b mask option register spi vector (high) spi vector (low) sci vector (high) sci vector (low) timer vector (high) timer vector (low) irq vector (high) irq vector (low) swi vector (high) swi vector (low) reset vector (high byte) reset vector (low byte) $0000 $0001 $0002 $0003 $0004 $0005 $0006 $0007 $0008 $0009 $000a $000b $000c $000d $000e $000f $0010 $0012 $0011 $0013 $0019 $001a $001b $001c $3ff2 $3ff4 $3ff3 $3ff5 $3ff6 $3ff7 $3ff8 i/o registers 32 bytes $0000 $001f $0020 $004f $0050 ram 176 bytes $00ff $0100 user eprom 15,744 bytes $017f $0180 user eprom vectors $3fff 14 bytes $0014 input capture register (low) output compare register (high) output compare register (low) timer counter register (high) $3ff9 $3ffb $3ffa $3ffc $3ffd $3ffe $3fff timer counter register (low) $0015 $0016 $0017 $0018 $001d $001e $001f alternate counter register (high) alternate counter register (low) unused cop reset register cop control register unused $3fef $3ff2 $3eff $3f00 (stack) 64 bytes ram 48 bytes ram0 = 1 user eprom 48 bytes ram0 = 0 ram ram1 = 1 user eprom ram1 = 0 128 bytes 128 bytes mask option registers bootloader rom and vectors 239 bytes $00bf $00c0 $3ff1 $3ff0 $3ff0 $3ff1 mask option register 2 unused (2 bytes) c9a option register $3fdf
eprom mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 27 figure 2-2. c12a memory map port a data register port b data register port c data register port d data register port a data direction register port b data direction register port c data direction register unused unused unused spi control register spi status register spi data register sci baud rate register sci control register 1 sci control register 2 sci status register sci data register timer control register timer status register input capture register (high) input capture register (low) output compare register (high) output compare register (low) timer counter register (high) timer counter register (low) alternate counter register (high) alternate counter register (low) unused unused unused unused unused spi vector (high) spi vector (low) sci vector (high) sci vector (low) timer vector (high) timer vector (low) irq vector (high) irq vector (low) swi vector (high) swi vector (low) reset vector (high byte) reset vector (low byte) $0000 $0001 $0002 $0003 $0004 $0005 $0006 $0007 $0008 $0009 $000a $000b $000c $000d $000e $000f $0010 $0012 $0011 $0013 $0019 $001a $001b $001c $3ff2 $3ff4 $3ff3 $3ff5 $3ff6 $3ff7 $3ff8 i/o registers 32 bytes $0000 $001f $0020 $004f $0050 ram 176 bytes $00ff $0100 user eprom 12,032 bytes user eprom vectors $3fff 14 bytes $0014 $3ff9 $3ffb $3ffa $3ffc $3ffd $3ffe $3fff $0015 $0016 $0017 $0018 $001d $001e $001f $3ff2 $3eff $3f00 (stack) 64 bytes bootloader rom and vectors 240 bytes $00bf $00c0 $3ff1 $3ff0 user eprom 48 bytes mask option register/c12 cop register unused 3840 bytes $0fff $1000 mask option register unused $3fef mask option registers $3ff0 $3ff1
memory mc68hc05c9a advance informati on data sheet, rev. 4.1 28 freescale semiconductor 2.4 eprom security a security feature has been incorporated into the mc 68hc705c9a to help prevent external access to the contents of the eprom in any mode of operation. on ce enabled, this feature can be disabled only by completely erasing the eprom. note for otp (plastic) packages, once the security feature has been enabled, it cannot be disabled. 2.5 rom the bootloader rom occupies 239 bytes in the memo ry space from $3f00 to $3fef. the bootloader mode provides for self-programming of the eprom array. see appendix a eprom programming . 2.6 i/o registers except for the option register, mask option register s, and the c12 cop clear register, all i/o, control and status registers are located within one 32-byte block in page zero of the address space ($0000?$001f). a summary of these registers is shown in figure 2-3 . more detail about the contents of these registers is given figure 2-4 .
i/o registers mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 29 addr register name $0000 port a data register $0001 port b data register $0002 port c data register $0003 port d data register $0004 port a data direction register $0005 port b data direction register $0006 port c data direction register $0007 port d data direction register (c9a only) $0008 unused $0009 unused $000a serial peripheral control register $000b serial peripheral status register $000c serial peripheral data register $000d baud rate register $000e serial communications control register 1 $000f serial communications control register 2 $0010 serial communications status register $0011 serial communications data register $0012 timer control register $0013 timer status register $0014 input capture register high $0015 input capture register low $0016 output compare register high $0017 output compare register low $0018 timer register high $0019 timer register low $001a alternate timer register high $001b alternate timer register low $001c eprom programming register $001d c9a cop reset register $001e c9a cop control register $001f reserved figure 2-3. i/o register summary
memory mc68hc05c9a advance informati on data sheet, rev. 4.1 30 freescale semiconductor addr. register name bit 7 6 5 4 3 2 1 bit 0 $0000 port a data register (porta) see page 47. read: pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 write: reset: unaffected by reset $0001 port b data register (portb) see page 48. read: pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 write: reset: unaffected by reset $0002 port c data register (portc) see page 48. read: pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 write: reset: unaffected by reset $0003 port d data register (portd) see page 48. read: pd7 pd5 pd4 pd3 pd2 pd1 pd0 write: reset: unaffected by reset $0004 port a data direction register (ddra) see page 47. read: ddra7 ddra6 ddra5 ddra4 ddra3 ddra2 ddra1 ddra0 write: reset: 0 0 0 0 0 0 0 0 $0005 port b data direction register (ddrb) see page 48. read: ddrb7 ddrb6 ddrb5 ddrb4 ddrb3 ddrb2 ddrb1 ddrb0 write: reset: 0 0 0 0 0 0 0 0 $0006 port c data direction register (ddrc) see page 48. read: ddrc7 ddrc6 ddrc5 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 write: reset: 0 0 0 0 0 0 0 0 $0007 port d data direction register (ddrd) c9a only see page 48. read: ddrc7 ddrc5 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 write: reset: 0 0 0 0 0 0 0 0 $0008 unimplemented $0009 unimplemented $000a spi control register (spcr) see page 75. read: spie spe dwom (c9a) mstr cpol cpha spr1 spr0 write: reset: 0 0 0 0 0 1 u u $000b spi status register (spsr) see page 76. read: spif wcol modf write: reset: 0 0 0 0 0 0 0 0 $000c spi data register (spdr) see page 77. read: spd7 spd6 spd5 spd4 spd3 spd2 spd1 spd0 write: reset: unaffected by reset = unimplemented r = reserved u = unaffected figure 2-4. input/output registers (sheet 1 of 3)
i/o registers mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 31 $000d sci baud rate register baud see page 69. read: scp1 scp0 scr2 scr1 scr0 write: reset: ? ? 0 0 ? u u u $000e sci control register 1 (sccr1) see page 65. read: r8 t8 m wake write: reset: u u 0 u u 0 0 0 $000f sci control register 2 (sccr2) see page 66. read: tie tcie rie ilie te re rwu sbk write: reset: 0 0 0 0 0 0 0 0 $0010 sci status register (scsr) see page 68. read: tdre tc rdrf idle or nf fe write: reset: 1 1 0 0 0 0 0 ? $0011 sci data register (scdr) see page 65. read: scd7 sdc6 scd5 scd4 scd3 scd2 scd1 scd0 write: reset: unaffected by reset $0012 timer control register (tcr) see page 53. read: icie ocie toie 000 iedg olvl write: reset: 0 0 0 0 0 0 u 0 $0013 timer status register (tsr) see page 54. read: icf ocf tof 0 0 0 0 0 write: reset: u u u 0 0 0 0 0 $0014 input capture register high (icrh) see page 56. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: unaffected by reset $0015 input capture register low (icrl) see page 56. read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: unaffected by reset $0016 output compare register high (ocrh) see page 56. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: unaffected by reset $0017 output compare register low (ocrl) see page 56. read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: unaffected by reset $0018 timer register high (trh) see page 55. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: 1 1 1 1 1 1 1 1 addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = unaffected figure 2-4. input/output registers (sheet 2 of 3)
memory mc68hc05c9a advance informati on data sheet, rev. 4.1 32 freescale semiconductor $0019 timer register low (trl) see page 55. read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: 1 1 1 1 1 1 0 0 $001a alternate timer register high (atrh) see page 55. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: 1 1 1 1 1 1 1 1 $001b alternate timer register low (atrl) see page 55. read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: 1 1 1 1 1 1 0 0 $001c eprom programming register (epr) read: latch epgm write: reset: 0 0 0 0 0 0 0 0 $001d cop reset register (coprst) c9a only see page 41. read: write: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reset: 0 0 0 0 0 0 0 0 $001e cop control register (copcr) c9a only see page 42. read: 0 0 0 copf cme cope cm1 cm0 write: reset: 0 0 0 u 0 0 0 0 $001f reserved r r r r r r r r addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = unaffected figure 2-4. input/output registers (sheet 3 of 3)
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 33 chapter 3 central processor unit (cpu) 3.1 introduction this section contains the basic programmers model and the registers contained in the cpu. 3.2 cpu registers the mcu contains five registers as shown in the programming model of figure 3-1 . the interrupt stacking order is shown in figure 3-2 . figure 3-1. programming model figure 3-2. interrupt stacking order a 70 x 70 hinzc ccr 11 sp 7 0 pc 15 0 accumulator index register program counter stack pointer condition code register 0 15 0 0 0 0 0 0 0 index register pcl accumulator condition code register pch 111 70 stack i n t e r r u p t decreasing unstack r e t u r n increasing memory addresses memory addresses
central processor unit (cpu) mc68hc05c9a advance informati on data sheet, rev. 4.1 34 freescale semiconductor 3.2.1 accumulator (a) the accumulator is a general-purpose 8-bit register used to hold operands and results of arithmetic calculations or data manipulations. 3.2.2 index register (x) the index register is an 8-bit register used for the indexed addressing value to create an effective address. the index register may also be used as a temporary storage area. 3.2.3 program counter (pc) the program counter is a 16-bit register that c ontains the address of the next byte to be fetched. 3.2.4 stack pointer (sp) the stack pointer contains the address of the next free location on the stack. during an mcu reset or the reset stack pointer (rsp) instruction, the stack pointer is set to location $0ff. the stack pointer is then decremented as data is pushed onto the stack and incremented as data is pulled from the stack. when accessing memory, the eight most significant bits are permanently set to 00000011. these eight bits are appended to the six least significant register bi ts to produce an address within the range of $00ff to $00c0. subroutines and interrupts may use up to 64 (decimal) locations. if 64 locations are exceeded, the stack pointer wraps around and loses the previously stored information. a subroutine call occupies two locations on the stack; an interrupt uses five locations. 3.2.5 condition code register (ccr) the ccr is a 5-bit register in which four bits are used to indicate the results of the instruction just executed, and the fifth bit indicates whether interrupts are masked. these bits can be individually tested by a program, and specific actions can be taken as a result of their state. each bit is explained in the following paragraphs. half carry (h) this bit is set during add and adc operations to indicate that a carry occurred between bits 3 and 4. interrupt (i) when this bit is set, the timer, sci, spi, and exte rnal interrupt are masked (disabled). if an interrupt occurs while this bit is set, the interrupt is latched and processed as soon as the interrupt bit is cleared. negative (n) when set, this bit indicates that the result of the last arithmetic, logical, or data manipulation was negative. zero (z) when set, this bit indicates that the result of the la st arithmetic, logical, or data manipulation was zero. carry/borrow (c) when set, this bit indicates that a carry or borrow out of the arithmetic logical unit (alu) occurred during the last arithmetic operation. this bit is al so affected during bit test and branch instructions and during shifts and rotates.
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 35 chapter 4 interrupts 4.1 introduction the mcu can be interrupted by five different sour ces, four maskable hardware interrupts, and one non-maskable software interrupt:  external signal on the irq pin or port b pins  16-bit programmable timer  serial communications interface  serial peripheral interface  software interrupt instruction (swi) interrupts cause the processor to save register content s on the stack and to set the interrupt mask (i bit) to prevent additional interrupts. the rti instruction ca uses the register contents to be recovered from the stack and normal processing to resume. unlike reset, hardware interrupts do not cause the current instruction execution to be halted, but are considered pending until the curr ent instruction is complete. note the current instruction is the one already fetched and being operated on. when the current instruction is complete, the processor checks all pending hardware interrupts. if interrupts are not masked (ccr i bit clear) and if th e corresponding interrupt enable bit is set, the processor proceeds with interrupt processing; othe rwise, the next instruction is fetched and executed. if an external interrupt and a timer, sci, or spi interrupt are pending at the end of an instruction execution, the external interrupt is serviced first. the swi is executed the same as any other instruction, regardless of the i-bit state. table 4-1 shows the relative priority of all the possible interrupt sources. figure 4-1 shows the interrupt processing flow. 4.2 non-maskable software interrupt (swi) the swi is an executable instruction and a non-maskabl e interrupt: it is executed regardless of the state of the i bit in the ccr. if the i bit is zero (interru pts enabled), swi executes after interrupts which were pending when the swi was fetched, but before interrupts generated after the swi was fetched. the interrupt service routine address is specified by the contents of memory locations $3ffc and $3ffd.
interrupts mc68hc05c9a advance informati on data sheet, rev. 4.1 36 freescale semiconductor 4.3 external interrupt (irq or port b) if the interrupt mask bit (i bit) of the ccr is set, a ll maskable interrupts (internal and external) are disabled. clearing the i bit enables interrupts. the interrupt request is latched immediately following the falling edge of irq . it is then synchronized interna lly and serviced as specified by the contents of $3ffa and $3ffb. when any of the port b pullups are enabled, each pin becomes an additional external interrupt source which is executed identically to the irq pin. port b interrupts follow the same edge/edge-level selection as the irq pin. the branch instructions bil and bih also respond to the port b interrupts in the same way as the irq pin. see 7.3 port b . either a level-sensitive and edge-sensitive trigger or an edge-sensitive-only trigger operation is selectable. in mc68hc05c9a mode, th e sensitivity is software controlled by the irq bit in the c9a option register ($3fdf). in the mc68hc05c12a mode, the sensitivity is determined by the c12irq bit in the c12 mask option register ($3ff1). note the internal interrupt latch is cleared in the first part of the interrupt service routine; therefore, one external interrupt pulse can be latched and serviced as soon as the i bit is cleared. table 4-1. vector addresses for interrupts and resets function source local mask global mask priority (1 = highest) vector address reset power-on reset none none 1 $3ffe?$3fff reset pin cop watchdog software interrupt (swi) user code none none same priority as instruction $3ffc?$3ffd external interrupt irq pin port b pins none i bit 2 $3ffa?$3ffb timer interrupts icf bit icie bit i bit 3 $3ff8?$3ff9 ocf bit ocie bit tof bit toie bit sci interrupts tdre bit tcie bit i bit 4 $3ff6?$3ff7 tc bit rdrf bit rie bit or bit idle bit ilie bit spi interrupts spif bit spie i bit 5 $3ff4?$3ff5 modf bit
external interrupt (irq or port b) mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 37 figure 4-1. interrupt flowchart fetch next instruction swi instruction ? rti instruction ? execute restore registers from stack: ccr,a,x,pc n y n y instruction stack pc,x,a,ccr set i bit in cc register load pc from: swi: $3ffc-$3ffd irq : $3ffa-$3ffb timer: $3ff8-$3ff9 sci: $3ff6-$3ff7 spi: $3ff4-$3ff5 internal spi interrupt internal sci interrupt y y y y n n n n n internal timer interrupt clear irq request latch irq or port b external interrupt i bit in ccr set? from reset y
interrupts mc68hc05c9a advance informati on data sheet, rev. 4.1 38 freescale semiconductor 4.4 timer interrupt three different timer interrupt flags cause a time r interrupt whenever they are set and enabled. the interrupt flags are in the timer status register (tsr), and the enable bits are in the timer control register (tcr). any of these interrupts will vector to the same interrupt service routine, located at the address specified by the contents of memory locations $3ff8 and $3ff9. 4.5 sci interrupt five different sci interrupt flags cause an sci interrupt whenever they are set and enabled. the interrupt flags are in the sci status register (scsr), and the e nable bits are in the sci control register 2 (sccr2). any of these interrupts will vector to the same interrupt service routine, located at the address specified by the contents of memory locations $3ff6 and $3ff7. 4.6 spi interrupt two different spi interrupt flags cause an spi interrupt whenever they are set and enabled. the interrupt flags are in the spi status register (spsr), and the enable bits are in the spi control register (spcr). either of these interrupts will vector to the same inte rrupt service routine, located at the address specified by the contents of memory locations $3ff4 and $3ff5.
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 39 chapter 5 resets 5.1 introduction the mcu can be reset four ways: by the initial power-on reset function, by an active low input to the reset pin, by the cop, or by the clock monitor. a re set immediately stops the operation of the instruction being executed, initializes some control bits, and lo ads the program counter with a user-defined reset vector address. figure 5-1 is a block diagram of the reset sources. figure 5-1. reset sources 5.2 power-on reset (por) a power-on-reset occurs when a pos itive transition is detected on v dd . the power-on reset is strictly for power turn-on conditions and should not be used to detec t a drop in the power supply voltage. there is a 4064 internal processor clock cycle (t cyc ) oscillator stabilization delay af ter the oscillator becomes active. (when configured as a c9a, the reset pin will output a logic 0 duri ng the 4064-cycle delay.) if the reset pin is low after the end of this 4064-cycle delay, the mcu will remain in the reset condition until reset is driven high externally. 5.3 reset pin the function of the reset pin is dependent on whether the device is configured as an mc68hc05c9a or an mc68hc05c12a. when it is in the mc68hc05c12a configuration, the pin is input only. when in mc68hc05c9a configuration the pin is bidirectional. in both cases the mcu is reset when a logic 0 is applied to the reset pin for a period of one and one-half machine cycles (t rl ). for the mc68hc05c9a configuration, the reset pin will be driven low by a cop, clock monitor, or power-on reset. v dd reset reset latch power-on reset d internal clock r rst to cpu and subsystems q stop clock monitor cop watchdog
resets mc68hc05c9a advance informati on data sheet, rev. 4.1 40 freescale semiconductor figure 5-2. power-on reset and reset 5.4 computer operating properly (cop) reset this device includes a watchdog cop feature which guards against program run-away failures. a timeout of the computer operating properly (cop) timer gener ates a cop reset. the cop watchdog is a software error detection system that automatically times out and resets the mcu if not cleared periodically by a program sequence. this device includes two cop types, one for c12a compatibility and the other for c9a compatibility. when configured as a c9a the cop can be enabled by user software by setting cope in the c9a cop control register (c9acopcr). when configured as a c1 2a, the cop is enabled prior to operation by programming the c12cope bit in the c12a mask opti on register (c12mor). the function and control of both cops is detailed below. reset osc1 2 internal clock 1 internal address bus 1 v dd internal data bus 1 t rl new pch new pcl op code op code pch pcl 3 t cyc 4064t cyc t vddr dummy 3fff new pc new pc 3ffe 3ffe 3ffe new pc new pc 3ffe 3fff 3ffe dummy notes: 1. internal timing signal and bus info rmation are not available externally. 2. osc1 line is not meant to represent fr equency. it is only mean t to represent time. 3. the next rising edge of the internal processor clock following the rising edge of reset initiates the reset sequence. t rl 3 reset (c9a) (c12a) 4 4. reset outputs v ol during 4064 power-on reset cycles when in c9a mode only.
mc68hc05c9a compatible cop mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 41 5.5 mc68hc05c9a compatible cop this cop is controlled with two registers; one to reset the cop timer and the other to enable and control cop and clock monitor functions. figure 5-3 shows a block diagram of the mc68hc05c9a cop. figure 5-3. c9a cop block diagram 5.5.1 c9a cop reset register this write-only register, shown in figure 5-4 , is used to reset the cop. the sequence required to reset the cop timer is:  write $55 to the cop reset register  write $aa to the cop reset register both write operations must occur in the order listed, but any number of instructions may be executed between the two write operations provided that th e cop does not time out between the two writes. the elapsed time between software resets must not be gr eater than the cop timeout period. if the cop should time out, a system reset will occur and the dev ice will be re-initialized in the same fashion as a power-on reset or reset. reading this register does not return valid data. 5.5.2 c9a cop control register the cop control register, shown in figure 5-5 , performs these functions:  enables clock monitor function  enables mc68hc05c9a compatible cop function  selects timeout duration of cop timer and flags the following conditions:  a cop timeout  clock monitor reset $001dbit 7654321bit 0 read: write: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reset:00000000 = unimplemented figure 5-4. cop reset register (coprst) 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 4 2 2 2 2 2 2 2 13 2 15 2 17 2 19 2 21 coprst cm0 cm1 16 bit timer system internal cpu clock cop
resets mc68hc05c9a advance informati on data sheet, rev. 4.1 42 freescale semiconductor copf ? computer operating properly flag reading the cop control register clears copf. 1 = cop or clock monitor reset has occurred. 0 = no cop or clock monitor reset has occurred. cme ? clock monitor enable bit this bit is readable any time, but may be written only once. 1 = clock monitor enabled 0 = clock monitor disabled cope ? cop enable bit this bit is readable any time. cope, cm1, and cm0 to gether may be written with a single write, only once, after reset. this bi t is cleared by reset. 1 = cop enabled 0 = cop disabled cm1 ? cop mode bit 1 used in conjunction with cm0 to establish the cop timeout period, this bit is readable any time. cope, cm1, and cm0 together may be written with a single writ e, only once, after reset. this bit is cleared by reset. cm0 ? cop mode bit 0 used in conjunction with cm1 to establish the cop timeout period, this bit is readable any time. cope, cm1, and cm0 together may be written with a single writ e, only once, after reset. this bit is cleared by reset. bits 7?5 ? not used these bits always read as 0. 5.6 mc68hc05c12a compatible cop this cop is implemented with an 18 -bit ripple counter. this provides a timeout period of 64 milliseconds at a bus rate (f op ) of 2 mhz. if the cop should time out, a sy stem reset will occur and the device will be re-initialized in the same fashion as a power-on reset or reset. $001ebit 7654321bit 0 read: 0 0 0 copf cme cope cm1 cm0 write: reset:000u0000 = unimplemented u = undetermined figure 5-5. cop control register (copcr) table 5-1. cop timeout period cm1 cm0 f op /2 15 divide by timeout period (f osc = 2.0 mhz) timeout period (f osc = 4.0 mhz) 0 0 1 32.77 ms 16.38 ms 0 1 4 131.07 ms 65.54 ms 1 0 16 524.29 ms 262.14 ms 1 1 64 2.097 sec 1.048 sec
mc68hc05c12a compatible cop clear register mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 43 5.7 mc68hc05c12a compatible cop clear register the cop clear register, shown in figure 5-6 , resets the c12a cop counter. copc ? computer operating properly clear bit preventing a cop reset is achieved by writing a 0 to the copc bit. this action will reset the counter and begin the timeout period again. the copc bit is bit 0 of address $3ff0. a read of address $3ff0 will result in the data programmed into the mask option register pbmor. 5.8 cop during wait mode either cop will continue to operate normally during wait mode. the software must pull the device out of wait mode periodically and reset the cop to prevent a system reset. 5.9 cop during stop mode stop mode disables the oscillator circuit and ther eby turns the clock off for the entire device. the cop counter will be reset when stop mode is entered. if a re set is used to exit stop mode, the cop counter will be reset after the 4064 cycles of delay after stop mode. if an irq is used to exit stop mode, the cop counter will not be reset after the 4064-cycle delay and will have that many cycles already counted when control is returned to the program. in the event that an inadvertent stop instruction is executed, neither cop will allow the system to recover. the mc68hc705c9a offers two solutions to this problem, one available in c9a mode (see 5.9.1 clock monitor reset ) and one available in c12a mode (see 5.9.2 stop instruction disable option ). 5.9.1 clock monitor reset when configured as a c9a, the clock monitor circuit can provide a system reset if the clock stops for any reason, including stop mode. when the cme bit in the c9a cop control register is set, the clock monitor detects the absence of the internal bus clock for a certain period of time. the timeout period is dependent on the processing parameters and varies from 5 s to 100 s, which implies that systems using a bus clock rate of 200 khz or less should not use the clock monitor. if a slow or absent clock is detected, the clock monito r causes a system reset. the reset is issued to the external system via the bidirectional reset pin for four bus cycles if the clock is slow or until the clocks recover in the case where the clocks are absent. $3ff0bit 7654321bit 0 read: write: copc reset:000u0000 = unimplemented u = undetermined figure 5-6. cop clear register (copclr)
resets mc68hc05c9a advance informati on data sheet, rev. 4.1 44 freescale semiconductor 5.9.2 stop instr uction disable option on the rom device mc68hc05c12a, stop mode can be disabled by mask option. this causes the cpu to interpret the stop instruction as a nop so the device will never enter stop mode; if the user code is not being executed properly, the cop will provide a system reset. to emulate this feature on the mc68hc705c9a (con figured as an mc68hc05c12a), set the stopdis bit in the c12mor. stop mode will not actually be disabled as on the mc68hc05c12a, but the clock monitor circuit will be activated. if the cpu executes a stop instruction, the clock monitor will provide a system reset. note this feature cannot be used with operating frequencies of 200 khz or less.
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 45 chapter 6 low-power modes 6.1 introduction this section describes the low-power modes. 6.2 stop mode the stop instruction places the mcu in its lowest-power consumption mode. in stop mode, the internal oscillator is turned off, ha lting all internal processi ng, including timer operation. during the stop mode, the tcr bits are altered to remove any pending timer interrupt request and to disable any further timer interrupts. the timer prescale r is cleared. the i bit in the ccr is cleared to enable external interrupts. all other registers and memory remain unaltered. all input/output lines remain unchanged. the processor can be brought out of the stop mode only by an external interrupt or reset. see figure 6-1 . figure 6-1. stop recovery timing diagram 3ffe 3ffe 3ffe 3ffe 3fff internal address bus internal clock irq (3) irq (2) reset osc1 (1) t ilch 4064 t cyc reset or interrupt vector fetch t lih t rl notes: 1. represents the internal gating of the osc1 pin 2. irq pin edge-sensitive mask option 3. irq pin level and edge-sensitive mask option
low-power modes mc68hc05c9a advance informati on data sheet, rev. 4.1 46 freescale semiconductor 6.3 wait mode the wait instruction places the mcu in a low-pow er consumption mode, but the wait mode consumes more power than the stop mode. all cpu action is suspended, but the timer, serial communications interface (sci), serial peripheral interface (spi), and the oscillator remain active. any interrupt or reset will cause the mcu to exit the wait mode. during wait mode, the i bit in the ccr is cleared to enable interrupts. all other registers, memory, and input/output lines remain in their previous state. the timer, sci, and spi may be enabled to allow a periodic exit from the wait mode.
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 47 chapter 7 input/output (i/o) ports 7.1 introduction this section briefly describes the 31 input/output (i/o ) lines arranged as one 7-bit and three 8-bit ports. all of these port pins are programmable as either inputs or outputs under software control of the data direction registers. note to avoid a glitch on the output pins, write data to the i/o port data register before writing a one to the corresponding data direction register. 7.2 port a port a is an 8-bit bidirectional port which does not s hare any of its pins with other subsystems. the port a data register is at $0000 and the data direction regi ster (ddr) is at $0004. the contents of the port a data register are indeterminate at initial powerup and must be initialized by user software. reset does not affect the data registers, but clears the data direction registers, thereby returning the ports to inputs. writing a 1 to a ddr bit sets the corresponding port bi t to output mode. a block diagram of the port logic is shown in figure 7-1 . figure 7-1. port a i/o circuit data direction register bit latched output data bit i/o pin input reg bit input i/o output internal hc05 connections
input/output (i/o) ports mc68hc05c9a advance informati on data sheet, rev. 4.1 48 freescale semiconductor 7.3 port b port b is an 8-bit bidirectional port. the port b data register is at $0001 and the data direction register (ddr) is at $0005. the contents of the port b data register are indeterminate at initial powerup and must be initialized by user software. reset does not affect the data registers, but clears the data direction registers, thereby returning the ports to inputs. writin g a 1 to a ddr bit sets the corresponding port pin to output mode. each of the port b pins has an optional external interrupt capabili ty that can be enabled by programming the corresponding bit in the port b mask option register ($3ff0). the interrupt option also enables a pullup device wh en the pin is configured as an input. the edge or edge- and level-sensitivity of the irq pin will also pertain to the enabled port b pins. care needs to be taken when using port b pins that have the pullup enabled. before switching from an output to an input, the data should be preconditioned to a 1 to prevent an interrupt from occurring. the port b logic is shown in figure 7-2 . 7.4 port c port c is an 8-bit bidirectional port. the port c data register is at $0002 and the data direction register (ddr) is at $0006. the contents of the port c data regi ster are indeterminate at initial powerup and must be initialized by user software. reset does not affect the data registers, but clears the data direction registers, thereby returning the ports to inputs. writ ing a 1 to a ddr bit sets t he corresponding port bit to output mode. pc7 has a high current sink and source capability. figure 7-1 is also applicable to port c. 7.5 port d when configured as a c9a, port d is a 7-bit bidirect ional port; when configured as a c12a, port d is a 7-bit fixed input port. four of its pins are shared wi th the spi subsystem and two more are shared with the sci subsystem. the contents of the port d data register are indeterminate at initial powerup and must be initialized by user software. during reset all seven bits become valid input ports because the c9a ddr bits are cleared and the special function output dr ivers associated with the sci and spi subsystems are disabled, thereby returning the ports to inputs. writi ng a 1 to a ddr bit sets the corresponding port bit to output mode only when configured as a c9a.
port d mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 49 figure 7-2. port b i/o logic data direction register b bit ddrb7 pbx external interrupt request port b data register bit pb7 read $0005 write $0001 read $0001 reset internal data bus write $0005 port b external interrupt from other v dd port b pins d c q r q i bit v dd (from ccr) reset external interrupt vector fetch irq mask option register controlled v dd enabled disabled edge only edge and level software or mask option register controlled dependent on configuration
input/output (i/o) ports mc68hc05c9a advance informati on data sheet, rev. 4.1 50 freescale semiconductor
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 51 chapter 8 capture/compare timer 8.1 introduction this section describes the operation of the 16-bit capture/compare timer. figure 8-1 shows the structure of the capture/compare subsystem. figure 8-1. capture/compare timer block diagram input capture register clock internal bus output compare register high byte low byte $16 $17 333 4 internal processor 16-bit free running counter counter alternate register 8-bit buffer high byte low byte $1a $1b $18 $19 high byte low byte $14 $15 output compare circuit overflow detect circuit edge detect circuit timer status reg. icf ocf tof $13 icie iedg olvl output level reg. reset timer control reg. $12 output level (tcmp) interrupt circuit toie ocie edge input (tcap) d clk c q
capture/compare timer mc68hc05c9a advance informati on data sheet, rev. 4.1 52 freescale semiconductor 8.2 timer operation the core of the capture/compare timer is a 16-bit free-running counter. the c ounter provides the timing reference for the input capture and output compare functions. the input capture and output compare functions provide a means to latch the times at which external events occur, to measure input waveforms, and to generate output waveforms and timing delay s. software can read the value in the 16-bit free-running counter at any time without affecting the counter sequence. because of the 16-bit timer architecture, the i/o registers for the input capture and output compare functions are pairs of 8-bit registers. because the counter is 16 bits long and preceded by a fixed divide-by-4 prescaler, the counter rolls over every 262,144 internal clock cycles. timer resolution with a 4-mhz crystal is 2 s. 8.2.1 input capture the input capture function is a means to record t he time at which an external event occurs. when the input capture circuitry detects an active edge on the tcap pin, it latches the contents of the timer registers into the input capture registers. the polarity of the active edge is programmable. latching values into the input capture registers at successive edges of the same polarity measures the period of the input signal on the tcap pin. latching va lues into the input capture registers at successive edges of opposite polarity measures the pulse width of the signal. 8.2.2 output compare the output compare function is a means of generatin g an output signal when the 16-bit counter reaches a selected value. software writes the selected value into the output compare registers. on every fourth internal clock cycle the output compar e circuitry compares the value of t he counter to the value written in the output compare registers. when a match occurs, the timer transfers the programmable output level bit (olvl) from the timer cont rol register to the tcmp pin. the programmer can use the output compare register to measure time periods, to generate timing delays, or to generate a pulse of specific duration or a pul se train of specific frequency and duty cycle on the tcmp pin. 8.3 timer i/o registers the following i/o registers control and monitor timer operation:  timer control register (tcr)  timer status register (tsr)  timer registers (trh and trl)  alternate timer registers (atrh and atrl)  input capture registers (icrh and icrl)  output compare registers (ocrh and ocrl)
timer i/o registers mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 53 8.3.1 timer control register the timer control register (tcr), shown in figure 8-2 , performs these functions:  enables input capture interrupts  enables output compare interrupts  enables timer overflow interrupts  controls the active edge polarity of the tcap signal  controls the active level of the tcmp output figure 8-2. timer control register (tcr) icie ? input capture interrupt enable bit this read/write bit enables interrupts caused by an active signal on the tcap pin. resets clear the icie bit. 1 = input capture interrupts enabled 0 = input capture interrupts disabled ocie ? output compare interrupt enable bit this read/write bit enables interrupts caused by an active signal on the tcmp pin. resets clear the ocie bit. 1 = output compare interrupts enabled 0 = output compare interrupts disabled toie ? timer overflow interrupt enable bit this read/write bit enables interrupts caused by a timer overflow. reset clear the toie bit. 1 = timer overflow interrupts enabled 0 = timer overflow interrupts disabled iedg ? input edge bit the state of this read/write bit determines whet her a positive or negative transition on the tcap pin triggers a transfer of the contents of the timer regi ster to the input capture register. resets have no effect on the iedg bit. 1 = positive edge (low to high transition) triggers input capture 0 = negative edge (high to low tr ansition) triggers input capture olvl ? output level bit the state of this read/write bit determines whether a logic 1 or logic 0 appears on the tcmp pin when a successful output compare occu rs. resets clear the olvl bit. 1 = tcmp goes high on output compare 0 = tcmp goes low on output compare $0012 bit 7 654321bit 0 read: icie ocie toie 000 iedg olvl write: reset:000000u0 = unimplemented u = undetermined
capture/compare timer mc68hc05c9a advance informati on data sheet, rev. 4.1 54 freescale semiconductor 8.3.2 timer status register the timer status register (tsr), shown in figure 8-3 , contains flags to signal the following conditions:  an active signal on the tcap pin, transferring the contents of the timer registers to the input capture registers  a match between the 16-bit counter and the output compare registers, transferring the olvl bit to the tcmp pin  a timer roll over from $ffff to $0000 icf ? input capture flag the icf bit is set automatically when an edge of th e selected polarity occurs on the tcap pin. clear the icf bit by reading the timer status register wi th icf set and then reading the low byte ($0015) of the input capture registers. resets have no effect on icf. ocf ? output compare flag the ocf bit is set automatically when the value of the timer registers matches the contents of the output compare registers. clear the ocf bit by reading the timer status register with ocf set and then reading the low byte ($0017) of the output compare registers. resets have no effect on ocf. tof ? timer overflow flag the tof bit is set automatically when the 16-bit counter rolls over from $ffff to $0000. clear the tof bit by reading the timer status register with to f set, and then reading the low byte ($0019) of the timer registers. resets have no effect on tof. $0013 bit 7 654321bit 0 read:icfocftof00000 write: reset:uuu00000 = unimplemented u = undetermined figure 8-3. timer status register (tsr)
timer i/o registers mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 55 8.3.3 timer registers the timer registers (trh and trl), shown in figure 8-4 , contains the current high and low bytes of the 16-bit counter. reading trh before reading trl causes trl to be latched until trl is read. reading trl after reading the timer status register clears the timer overflow flag (tof). writing to the timer registers has no effect. figure 8-4. timer registers (trh and trl) 8.3.4 alternate timer registers the alternate timer registers (atrh and atrl), shown in figure 8-5 , contain the current high and low bytes of the 16-bit counter. reading atrh before read ing atrl causes atrl to be latched until atrl is read. reading atrl has no effect on the timer over flow flag (tof). writing to the alternate timer registers has no effect. figure 8-5. alternate timer registers (atrh and atrl) note to prevent interrupts from occurring between readings of atrh and atrl, set the interrupt flag in the condition code register before reading atrh, and clear the flag after reading atrl. trh $0018bit 7654321bit 0 read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write reset:11111111 trl $0019bit 7654321bit 0 read:bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:11111100 = unimplemented atrh $001abit 7654321bit 0 read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset:11111111 atrl $001bbit 7654321bit 0 read:bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset:11111100 = unimplemented
capture/compare timer mc68hc05c9a advance informati on data sheet, rev. 4.1 56 freescale semiconductor 8.3.5 input capture registers when a selected edge occurs on the tcap pin, the current high and low bytes of the 16-bit counter are latched into the input capture registers (icrh and icrl). reading icrh before reading icrl inhibits further capture until icrl is read. reading icrl after reading the status register clears the input capture flag (icf). writing to the input capture registers has no effect. figure 8-6. input capture registers (icrh and icrl) note to prevent interrupts from occurri ng between readings of icrh and icrl, set the interrupt flag in the condition code register before reading icrh, and clear the flag after reading icrl. 8.3.6 output co mpare registers when the value of the 16-bit counter matches t he value in the output compare registers (ocrh and ocrl), the planned tcmp pin action takes place. writi ng to ocrh before writing to ocrl inhibits timer compares until ocrl is written. reading or writing to ocrl after the timer status register clears the output compare flag (ocf). figure 8-7. output compare registers (ocrh and ocrl) icrh $0014bit 7654321bit 0 read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: unaffected by reset icrl $0015bit 7654321bit 0 read:bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset: unaffected by reset = unimplemented ocrh $0016bit 7654321bit 0 write: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 read: reset: unaffected by reset ocrl $0017bit 7654321bit 0 read: bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0 write: reset: unaffected by reset
timer during wait mode mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 57 to prevent ocf from being set between the time it is read and the time the output compare registers are updated, use this procedure: 1. disable interrupts by setting the i bit in the condition code register. 2. write to ocrh. compares are now inhibited until ocrl is written. 3. clear bit ocf by reading ti mer status register (tsr). 4. enable the output compare function by writing to ocrl. 5. enable interrupts by clearing the i bit in the condition code register. 8.4 timer during wait mode the cpu clock halts during the wait mode, but the timer remains active. if interrupts are enabled, a timer interrupt will cause the processor to exit the wait mode. 8.5 timer during stop mode in the stop mode, the timer stops counting and holds the last count value if stop is exited by an interrupt. if stop is exited by reset, the counters are forced to $fffc. during stop, if at least one valid input capture edge occurs at the tcap pins, the input captur e detect circuit is armed. this does not set any timer flags or wake up the mcu, but if an interrupt is used to exit stop mode, there is an active input capture flag and data from the first valid edge that oc curred during the stop mode. if reset is used to exit stop mode, then no input capture flag or data remains, even if a valid input capture edge occurred.
capture/compare timer mc68hc05c9a advance informati on data sheet, rev. 4.1 58 freescale semiconductor
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 59 chapter 9 serial communications interface (sci) 9.1 introduction this section describes the on-chip asynchronous seri al communications interface (sci). the sci allows full-duplex, asynchronous, rs232 or rs422 serial communication between the mcu and remote devices, including other mcus. the transmitter and receiver of the sci operate independently, although they use the same baud rate generator. 9.2 features features of the sci include:  standard mark/space non-return-to-zero format  full-duplex operation  32 programmable baud rates  programmable 8-bit or 9-bit character length  separately enabled transmitter and receiver  two receiver wakeup methods: ? idle line wakeup ? address mark wakeup  interrupt-driven operation capability with five interrupt flags: ? transmitter data register empty ? transmission complete ? transmission data register full ? receiver overrun ? idle receiver input  receiver framing error detection  1/16 bit-time noise detection 9.3 sci receiver features features of the sci receiver include:  receiver wakeup function (idle line or address bit)  idle line detection  framing error detection  noise detection  overrun detection  receiver data register full flag
serial communications interface (sci) mc68hc05c9a advance informati on data sheet, rev. 4.1 60 freescale semiconductor 9.4 sci transmitter features features of the sci transmitter include:  transmit data register empty flag  transmit complete flag  send break figure 9-1. serial communications interface block diagram note the serial communications data register (sci scdr) is controlled by the internal r/w signal. it is the transmit data register when written to and the receive data register when read. + + internal bus sci interrupt transmit receive tdo pin rdi transmitter control receiver control clock pin receiver flag control data data tie tcie rie ilie te re sbk rwu 7 6 5 4 3 2 1 0 $000f sccr2 scsr $0010 sccr1 $000e trde tc rdrf idle or nf fe te sbk $0011 r8 t8 m wake 0 1 2 4 3 6 5 7 765 2 3 4 1 wakeup unit receive data shift register transmit data shift register $0011 7 &&&& register register
functional description mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 61 9.5 functional description a block diagram of the sci is shown in figure 9-1 . option bits in serial control register1 (sccr1) select the wakeup method (wake bit) and data word length (m bit) of the sci. sccr2 provides control bits that individually enable the transmitter and receiver, enabl e system interrupts, and provide the wakeup enable bit (rwu) and the send break code bit (sbk). control bits in the baud rate register (baud) allow the user to select one of 32 different baud rates for the transmitter and receiver. data transmission is initiated by writing to the se rial communications data regi ster (scdr). provided the transmitter is enabled, data stored in the scdr is tr ansferred to the transmit data shift register. this transfer of data sets the transmit data register empty flag (tdre) in the sci status register (scsr) and generates an interrupt (if transmitter interrupts are enabl ed). the transfer of data to the transmit data shift register is synchronized with the bit rate clock (see figure 9-2 ). all data is transmitted least significant bit first. upon completion of data transmission, the tr ansmission complete flag (t c) in the scsr is set (provided no pending data, preamble, or break is to be sent) and an interrupt is generated (if the transmit complete interrupt is enabled). if the transmitter is disabled, and the data, preamble, or break (in the transmit data shift register) has been sent, the tc bit will be set also. this will also generate an interrupt if the transmission complete interrupt enable bit (tcie) is set. if the transmitter is disabled during a transmission, the character being transmitted will be completed before the transmitter gives up control of the tdo pin. when scdr is read, it contains the last data byte received, provided that the receiver is enabled. the receive data register full flag bit (rdrf) in the sc sr is set to indicate that a data byte has been transferred from the input serial shift register to the scdr; this will cause an interrupt if the receiver interrupt is enabled. the data transfer from the input se rial shift register to the scdr is synchronized by the receiver bit rate clock. the or (overrun), nf (noi se), or fe (framing) error flags in the scsr may be set if data reception errors occurred. an idle line interrupt is generated if the idle line inte rrupt is enabled and the idle bit (which detects idle line transmission) in scsr is set. th is allows a receiver that is not in the wakeup mode to detect the end of a message, or the preamble of a new message, or to re-synchronize with the transmitter. a valid character must be received before the idle line cond ition or the idle bit will not be set and idle line interrupt will not be generated. figure 9-2. rate generator division osc freq (f osc ) 3 2 bus freq (f op ) scp0?scp1 sci prescaler select n scr0?scr2 sci rate select m 16 sci trans clock (tx) sci receive clock (rt) control control
serial communications interface (sci) mc68hc05c9a advance informati on data sheet, rev. 4.1 62 freescale semiconductor 9.6 data format receive data or transmit data is the serial data that is transferred to the internal data bus from the receive data input pin (rdi) or from the internal bus to t he transmit data output pin (tdo). the non-return-to-zero (nrz) data format shown in figure 9-3 is used and must meet the following criteria:  the idle line is brought to a logic 1 state prior to transmission/reception of a character.  a start bit (logic 0) is used to indicate the start of a frame.  the data is transmitted and received least significant bit first.  a stop bit (logic 1) is used to indicate the end of a frame. a frame consists of a start bit, a character of eight or nine data bits, and a stop bit.  a break is defined as the transmission or reception of a low (logic 0) for at least one complete frame time. figure 9-3. data format 9.7 receiver wakeup operation the receiver logic hardware also supports a receiver wakeup function which is intended for systems having more than one receiver. with this function a transmitting device directs messages to an individual receiver or group of receivers by passing addressing information as the initial byte(s) of each message. the wakeup function allows receivers not addressed to remain in a dormant state for the remainder of the unwanted message. this eliminates any further software overhead to service the remaining characters of the unwanted message and thus im proves system performance. the receiver is placed in wakeup mode by setting t he receiver wakeup bit (rwu) in the sccr2 register. while rwu is set, all of the receiver-related stat us flags (rdrf, idle, or, nf, and fe) are inhibited (cannot become set). note the idle line detect function is inhibited while the rwu bit is set. although rwu may be cleared by a software write to sccr2, it would be unusual to do so. normally, rwu is set by software and is cleared automatically in hardware by one of these methods: idle line wakeup or address mark wakeup. 9.8 idle line wakeup in idle line wakeup mode, a dormant receiver wakes up as soon as the rdi line becomes idle. idle is defined as a continuous logic high level on the rdi li ne for 10 (or 11) full bit times. systems using this type of wakeup must provide at least one character time of idle between messages to wake up sleeping receivers, but must not allow any idle time between characte rs within a message. idle line 012345678 0 stop start start control bit m selects 8- or 9-bit data
address mark wakeup mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 63 9.9 address mark wakeup in address mark wakeup, the most significant bit (msb) in a character is used to indicate whether it is an address (logic 1) or data (logic 0) character. sleeping receivers will wake up whenever an address character is received. systems using this method for wakeup would set the msb of the first character of each message and leave it clear for all other characte rs in the message. idle periods may be present within messages and no idle time is required between messages for this wakeup method. 9.10 receive data in (rdi) receive data is the serial data that is applied through the input line and the sci to the internal bus. the receiver circuitry clocks the input at a rate equal to 16 times the baud rate. this time is referred to as the rt rate in figure 9-4 and as the receiver clock in figure 9-6 . the receiver clock generator is controlled by the baud rate register; however, the sci is synchronized by the start bit, independent of the transmitter. once a valid start bit is detected, the start bit, each data bit, and the stop bit are sampled three times at rt intervals 8 rt, 9 rt, and 10 rt (1 rt is the position where the bit is expected to start), as shown in figure 9-5 . the value of the bit is determined by voting logic which takes the value of th e majority of the samples. a noise flag is set when all three samples on a valid start bit or data bit or the stop bit do not agree. figure 9-4. sci examples of start bit sampling techniques figure 9-5. sci sampling techniq ue used on all bits 111111110 0 0 0 111111110 0 1 0 11101111 0000 noise noise start start start rdi rdi rdi idle 1rt 2rt 3rt 4rt 5rt 6rt 7rt rt clock edges for all three examples 16x internal sampling clock 9rt 8rt 10rt 16rt 1rt 16rt 1rt samples next bit previous bit rdi
serial communications interface (sci) mc68hc05c9a advance informati on data sheet, rev. 4.1 64 freescale semiconductor 9.11 start bit detection when the input (idle) line is detected low, it is tested for three more sample times (referred to as the start edge verification samples in figure 9-4 ). if at least two of these three verification samples detect a logic 0, a valid start bit has been detected; otherwise, the li ne is assumed to be idle. a noise flag is set if all three verification samples do not detect a logic 0. t hus, a valid start bit could be assumed with a set noise flag present. if a framing error has occurred without detection of a break (10 0s for 8-bit format or 11 0s for 9-bit format), the circuit co ntinues to operate as if there actually was a stop bit, and the start edge will be placed artificially. the last bit re ceived in the data shift register is inverted to a logic 1, and the three logic 1 start qualifiers (shown in figure 9-4 ) are forced into the sample shift register during the interval when detection of a start bit is anticipated (see figure 9-6 ); therefore, the start bit will be accepted no sooner than it is anticipated. if the receiver detects that a break (rdrf = 1, fe = 1, receiver data register = $003b) produced the framing error, the start bit will not be artificially induced and the rece iver must actually detect a logic 1 before the start bit can be recognized (see figure 9-7 ). figure 9-6. sci artificial start following a frame error figure 9-7. sci start bit following a break data expected stop data samples artificial edge start bit data rdi data expected stop data samples start edge start bit data rdi a) case 1: receive line low during artificial edge b) case 2: receive line high during expected start edge expected stop data samples detected as valid start edge start bit rdi break start qualifiers start edge verification samples
transmit data out (tdo) mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 65 9.12 transmit data out (tdo) transmit data is the serial data from the internal data bus that is applied through the sci to the output line. data format is as discussed in 9.6 data format and shown in figure 9-3 . the transmitter generates a bit time by using a derivative of the rt clock, thus producing a transmission rate equal to 1/16th that of the receiver sample clock. 9.13 sci i/o registers the following i/o registers control and monitor sci operation:  sci data register (scdr)  sci control register 1 (sccr1)  sci control register 2 (sccr2)  sci status register (scsr) 9.13.1 sci data register the sci data register (scdr), shown in figure 9-8 , is the buffer for characters received and for characters transmitted. 9.13.2 sci cont rol register 1 the sci control register 1 (sccr1), shown in figure 9-9 , has these functions:  stores ninth sci data bit received and ninth sci data bit transmitted  controls sci character length  controls sci wakeup method r8 ? bit 8 (received) when the sci is receiving 9-bit characters, r8 is the ninth bit of the received character. r8 receives the ninth bit at the same time that the scdr receives the other eight bi ts. resets have no effect on the r8 bit. $0011 bit 7 654321bit 0 read: bit7 bit6 bit55 bit4 bit3 bit2 bit1 bit0 write: reset: unaffected by reset figure 9-8. sci data register (scdr) $000ebit 7654321bit 0 read: r8 t8 m wake write: reset: u u 0 u u 0 0 0 = unimplemented u = undetermined figure 9-9. sci control register 1 (sccr1)
serial communications interface (sci) mc68hc05c9a advance informati on data sheet, rev. 4.1 66 freescale semiconductor t8 ? bit 8 (transmitted) when the sci is transmitting 9-bit characters, t8 is the ninth bit of the transmitted character. t8 is loaded into the transmit shift register at the same time that the scdr is loaded into the transmit register. resets have no effect on the t8 bit. m ? character length bit this read/write bit determines whether sci characters are 8 bits long or 9 bits long. the ninth bit can be used as an extra stop bit, as a receiver wakeup si gnal, or as a mark or space parity bit. resets have no effect on the m bit. 1 = 9-bit sci characters 0 = 8-bit sci characters wake ? wakeup method bit this read/write bit determines which condition wakes up the sci: a logic 1 (address mark) in the most significant bit (msb) position of a received characte r or an idle condition on the pd0/rdi pin. resets have no effect on the wake bit. 1 = address mark wakeup 0 = idle line wakeup 9.13.3 sci cont rol register 2 sci control register 2 (sccr2), shown in figure 9-10 , has these functions:  enables the sci receiver and sci receiver interrupts  enables the sci transmitter and sci transmitter interrupts  enables sci receiver idle interrupts  enables sci transmission complete interrupts  enables sci wakeup  transmits sci break characters tie ? transmit interrupt enable bit this read/write bit enables sci interrupt requests when the tdre flag becomes set. resets clear the tie bit. 1 = tdre interrupt requests enabled 0 = tdre interrupt requests disabled tcie ? transmission complete interrupt enable bit this read/write bit enables sci interrupt requests when the tc flag becomes set. resets clear the tcie bit. 1 = tc interrupt requests enabled 0 = tc interrupt requests disabled $000f bit 7 654321bit 0 read: tie tcie rie ilie te re rwu sbk write: reset:00000000 figure 9-10. sci control register 2 (sccr2)
sci i/o registers mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 67 rie ? receiver interrupt enable bit this read/write bit enables sci in terrupt requests when the rdrf fl ag or the or flag becomes set. resets clear the rie bit. 1 = rdrf interrupt requests enabled 0 = rdrf interrupt requests disabled ilie ? idle line interrupt enable bit this read/write bit enables sci interrupt requests when the idle bit becomes set. resets clear the ilie bit. 1 = idle interrupt requests enabled 0 = idle interrupt requests disabled te ? transmitter enable bit setting this read/write bit begins the transmission by sending a preamble of 10 or 11 logic 1s from the transmit shift register to the pd1/tdo pin. resets clear the te bit. 1 = transmission enabled 0 = transmission disabled re ? receiver enable bit setting this read/write bit enables the receiver. clear ing the re bit disables the receiver and receiver interrupts but does not affect the receiver interrupt flags. resets clear the re bit. 1 = receiver enabled 0 = receiver disabled rwu ? receiver wakeup enable bit this read/write bit puts the receiver in a standby state. typically, data transmitted to the receiver clears the rwu bit and returns the receiver to norma l operation. the wake bit in sccr1 determines whether an idle input or an address mark brings the receiver out of standby state. reset clears the rwu bit. 1 = standby state 0 = normal operation sbk ? send break bit setting this read/write bit continuously transmits break codes in the form of 10-bit or 11-bit groups of logic 0s. clearing the sbk bit stops the break codes and transmits a l ogic 1 as a start bit. reset clears the sbk bit. 1 = break codes being transmitted 0 = no break codes being transmitted 9.13.4 sci status register the sci status register (scsr), shown in figure 9-11 , contains flags to signal the following conditions:  transfer of scdr data to transmit shift register complete  transmission complete  transfer of receive shift register data scdr complete  receiver input idle  noisy data  framing error
serial communications interface (sci) mc68hc05c9a advance informati on data sheet, rev. 4.1 68 freescale semiconductor tdre ? transmit data register empty flag this clearable, read-only flag is set when the data in the scdr transfers to the transmit shift register. tdre generates an interrupt request if the tie bit in sccr2 is also set. clear the tdre bit by reading the scsr with tdre set and then writing to th e scdr. reset sets the tdre bit. software must initialize the tdre bit to logic 0 to avoid an instant interrupt request when turning the transmitter on. 1 = scdr data transferred to transmit shift register 0 = scdr data not transferred to transmit shift register tc ? transmission complete flag this clearable, read-only flag is set when the tdre bit is set, and no data, preamble, or break character is being transmitt ed. tdre generates an interrupt request if the tcie bit in sccr2 is also set. clear the tc bit by reading the scsr with tc set, and then writing to t he scdr. reset sets the tc bit. software must initialize the tc bit to logi c 0 to avoid an instant interrupt request when turning the transmitter on. 1 = no transmission in progress 0 = transmission in progress rdrf ? receive data register full flag this clearable, read-only flag is set when the data in the receive shift register transfers to the sci data register. rdrf generates an interrupt request if the ri e bit in the sccr2 is al so set. clear the rdrf bit by reading the scsr with r drf set and then reading the scdr. 1 = received data available in scdr 0 = received data not available in scdr idle ? receiver idle flag this clearable, read-only flag is set when 10 or 11 consecutive logic 1s appear on the receiver input. idle generates an interrupt request if the ilie bit in the sccr2 is also set. clear the ilie bit by reading the scsr with idle set and then reading the scdr. 1 = receiver input idle 0 = receiver input not idle or ? receiver overrun flag this clearable, read-only flag is set if the scdr is not read before the receive shift register receives the next word. or generates an interrupt request if th e rie bit in the sccr2 is also set. the data in the shift register is lost, but the data already in t he scdr is not affected. clear the or bit by reading the scsr with or set and then reading the scdr. 1 = receive shift register full and rdrf = 1 0 = no receiver overrun nf ? receiver noise flag this clearable, read-only flag is set when noise is detected in data received in the sci data register. clear the nf bit by reading the scsr and then reading the scdr. 1 = noise detected in scdr 0 = no noise detected in scdr $0010 bit 7 654321bit 0 read: tdre tc rdrf idle or nf fe write: reset:1100000? = unimplemented figure 9-11. sci status register (scsr)
sci i/o registers mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 69 fe ? receiver framing error flag this clearable, read-only flag is set when there is a logic 0 where a stop bit should be in the character shifted into the receive shift register. if the rece ived word causes both a framing error and an overrun error, the or flag is set and the fe flag is not set. clear the fe bit by reading the scsr and then reading the scdr. 1 = framing error 0 = no framing error 9.13.5 baud rate register the baud rate register (baud), shown in figure 9-12 , selects the baud rate for both the receiver and the transmitter. scp1 ? scp0?sci prescaler select bits these read/write bits control prescaling of the baud rate generator clock, as shown in table 9-1 . reset clears both scp1 and scp0. scr2 ? scr0?sci baud rate select bits these read/write bits select the sci baud rate, as shown in table 9-2 . resets have no effect on the scr2?scr0 bits. $000dbit 7654321bit 0 read: scp1 scp0 scr2 scr1 scr0 write: reset: ? ? 0 0 ? u u u = unimplemented u = undetermined figure 9-12. baud rate register (baud) table 9-1. baud rate generator clock prescaling scp[1:0] baud rate generator clock 00 internal clock 1 01 internal clock 3 10 internal clock 4 11 internal clock 13 table 9-2. baud rate selection scr[2:0] sci baud rate (baud) 000 prescaled clock 1 001 prescaled clock 2 010 prescaled clock 4 011 prescaled clock 8 100 prescaled clock 16 101 prescaled clock 32 110 prescaled clock 64 111 prescaled clock 128
serial communications interface (sci) mc68hc05c9a advance informati on data sheet, rev. 4.1 70 freescale semiconductor
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 71 chapter 10 serial peripheral interface (spi) 10.1 introduction the serial peripheral interface (spi) is an interface built into the device which allows several mc68hc05 mcus, or mc68hc05 mcu plus peripheral devices, to be interconnected within a single printed circuit board. in an spi, separate wires are required for dat a and clock. in the spi format, the clock is not included in the data stream and must be furnished as a separate signal. an spi system may be configured in one containing one master mcu and several slave m cus, or in a system in which an mcu is capable of being a master or a slave. 10.2 features features include:  full-duplex, four-wire synchronous transfers  master or slave operation  bus frequency divided by 2 (maximum) master bit frequency  bus frequency (maximum) slave bit frequency  four programmable master bit rates  programmable clock polarity and phase  end of transmission interrupt flag  write collision flag protection  master-master mode fault protection capability 10.3 spi signal description the four basic signals (mosi, miso, sck, and ss ) are described in the following paragraphs. each signal function is described for both the master and slave modes. note in c9a mode, any spi output line has to have its corresponding data direction register bit set. if this bit is clear, the line is disconnected from the spi logic and becomes a general-purpose input line. when the spi is enabled, any spi input line is forced to act as an input regardless of what is in the corresponding data direction register bit.
serial peripheral interface (spi) mc68hc05c9a advance informati on data sheet, rev. 4.1 72 freescale semiconductor figure 10-1. data clock timing diagram 10.3.1 master in slave out (miso) the miso line is configured as an input in a master device and as an output in a slave device. it is one of the two lines that transfer serial data in one direction, with the most si gnificant bit sent first. the miso line of a slave device is placed in the high- impedance state if the slave is not selected. 10.3.2 master out slave in (mosi) the mosi line is configured as an output in a master device and as an input in a slave device. it is one of the two lines that transfer serial data in one di rection with the most significant bit sent first. 10.3.3 serial clock (sck) the master clock is used to synchronize data moveme nt both in and out of the device through its mosi and miso lines. the master and slave devices are capa ble of exchanging a byte of information during a sequence of eight clock cycles. sinc e sck is generated by the master device, this line becomes an input on a slave device. as shown in figure 10-1 , four possible timing relationships may be chosen by using control bits cpol and cpha in the serial peripheral control register (spcr). both master and slave devices must operate with the same timing. the master device always places dat a on the mosi line a half cycle before the clock edge (sck), in order for the slave device to latch the data. two bits (spr0 and spr1) in the spcr of the master device select the clock rate. in a slave device, spr0 and spr1 have no effect on the operation of the spi. 10.3.4 slave select (ss ) the slave select (ss ) input line is used to select a slave device. it has to be low prior to data transactions and must stay low for the duration of the transaction.the ss line on the master must be tied high. in master mode, if the ss pin is pulled low during a transmission, a mode fault error flag (modf) is set in msb 5 3 64 21 0 internal strobe for data capture (all modes) miso/mosi sck sck sck sck ss cpol = 0 cpha = 0 cpol = 0 cpha = 1 cpol = 1 cpha = 1 cpol = 1 cpha = 0
functional description mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 73 the spsr. in master mode the ss pin can be selected to be a general-purpose output (when configured as an mc68hc05c9a) by writing a 1 in bit 5 of the por t d data direction register, thus disabling the mode fault circuit. when cpha = 0, the shift clock is the or of ss with sck. in this clock phase mode, ss must go high between successive characters in an spi message. when cpha = 1, ss may be left low for several spi characters. in cases where there is only one spi slave mcu, its ss line could be tied to v ss as long as cpha = 1 clock modes are used. 10.4 functional description figure 10-2 shows a block diagram of the serial peripher al interface circuitry. when a master device transmits data to a slave via the mosi line, the sl ave device responds by sending data to the master device via the master?s miso line. this implies fu ll duplex transmission with both data out and data in synchronized with the same clock signal. thus, the by te transmitted is replaced by the byte received and eliminates the need for separate transmit-empty and receiv e-full status bits. a single status bit (spif) is used to signify that the i/o operation has been completed. figure 10-2. serial peri pheral interface block diagram 6 7 543210 spe spie spi control register (spcr) mstr cpol cpha spr1 spr2 $000a wcol spif spi status register (spsr) 0 modf 0 0 $000b bit 6 bit 7 spi data register (spdr) bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 $000c dwom 00 spi shift register divider clock logic spdr ($000c) 7 6 5 4 3 2 1 0 modf wcol spif spr1 spr0 cpol cpha mstr spe spie pd3/ mosi pd2/ miso 2 32 16 4 select spi control internal data bus mstr s m s m internal clock (xtal 2) spi clock (master) spi interrupt request shift clock pd4/ sck pd5/ ss (slave) spi spi (master) clock clock
serial peripheral interface (spi) mc68hc05c9a advance informati on data sheet, rev. 4.1 74 freescale semiconductor the spi is double buffered on read, but not on write. if a write is performed during data transfer, the transfer occurs uninterrupted, and the write will be unsuccessful. this condition will cause the write collision (wcol) status bit in the spsr to be set. a fter a data byte is shifted, the spif flag of the spsr is set. in the master mode, the sck pin is an output. it idles high or low, depending on the cpol bit in the spcr, until data is written to the shift register, at which poin t eight clocks are generated to shift the eight bits of data and then sck goes idle again. in a slave mode, the slave select start logic receives a logic low at the ss pin and a clock at the sck pin. thus, the slave is synchronized with the master. data from the master is received serially at the mosi line and loads the 8-bit shift register. after the 8-bit shi ft register is loaded, its data is parallel transferred to the read buffer. during a write cycle, data is written into the shift register, then the slave waits for a clock train from the master to shift the data out on the slave?s miso line. figure 10-3 illustrates the mosi, miso, sck, and ss master-slave interconnections. figure 10-3. serial peripheral interface master-slave interconnection 10.5 spi registers three registers in the spi provide control, status, and data storage functions. these registers are called the serial peripheral control register (spcr), seri al peripheral status register (spsr), and serial peripheral data i/o register (spdr) and are described in the following paragraphs. 10.5.1 serial peripher al control register the spi control register (spcr), shown in figure 10-4 , controls these functions:  enables spi interrupts  enables the spi system  selects between standard cmos or open drain outputs for port d (c9a mode only)  selects between master mode and slave mode  controls the clock/data relationship between master and slave  determines the idle level of the clock pin spi shift register 7 6 5 4 3 2 1 0 spi shift register 7 6 5 4 3 2 1 0 spdr ($000c) spdr ($000c) pd3/mosi pd2/miso pd5/ss pd4/sck master mcu slave mcu i/o port
spi registers mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 75 spie ? serial peripheral interrupt enable bit this read/write bit enables spi interrupts. reset clears the spie bit. 1 = spi interrupts enabled 0 = spi interrupts disabled spe ? serial peripheral system enable bit this read/write bit enables the spi. reset clears the spe bit. 1 = spi system enabled 0 = spi system disabled dwom ? port d wire-or mode option bit this read/write bit disables the high side driver transistors on port d outputs so that port d outputs become open-drain drivers. dwom affects all seven port d pins together. this option is only available when configured as a c9a. 1 = port d outputs act as open-drain outputs. 0 = port d outputs are normal cmos outputs. mstr ? master mode select bit this read/write bit selects master mode operation or slave mode operation. reset clears the mstr bit. 1 = master mode 0 = slave mode cpol ? clock polarity bit when the clock polarity bit is cleared and data is not being transferred, a steady state low value is produced at the sck pin of the master device. conversely, if this bit is set, the sck pin will idle high. this bit is also used in conjunction with the cloc k phase control bit to produce the desired clock-data relationship between master and slave. see figure 10-1 . cpha ? clock phase bit the clock phase bit, in conjunction wi th the cpol bit, controls the clock-data relationship between master and slave. the cpol bit can be thought of as si mply inserting an inverter in series with the sck line. the cpha bit selects one of two fu ndamentally different clocking protocols. when cpha = 0, the shift clock is the or of sck with ss . as soon as ss goes low, the transaction begins and the first edge on sck invokes the first data sample. when cpha=1, the ss pin may be thought of as a simple output enable control. see figure 10-1 . spr1 and spr0 ? spi clock rate selects these read/write bits select one of four master mode serial clock rates, as shown in table 10-1 . they have no effect in the slave mode. $000abit 7654321bit 0 read: spie spe dwom (c9a) mstr cpol cpha spr1 spr0 write: reset:000001uu u = undetermined figure 10-4. spi control register (spcr)
serial peripheral interface (spi) mc68hc05c9a advance informati on data sheet, rev. 4.1 76 freescale semiconductor 10.5.2 serial peri pheral status register the spi status register (spsr), shown in figure 10-5 , contains flags to signal the following conditions:  spi transmission complete  write collision  mode fault spif ? spi transfer complete flag the serial peripheral data transfer flag bit is set upon completion of data transfer between the processor and external device. if spif goes high, and if spie is set, a serial peripheral interrupt is generated. clearing the spif bit is accomplished by reading the spsr (with spif set) followed by an access of the spdr. following the initial transfer, unless spsr is read (with spif set) first, attempts to write to spdr are inhibited. wcol ? write collision bit the write collision bit is set when an attempt is made to write to the serial peripheral data register while data transfer is taking place. if cpha is 0, a transfer is said to begin when ss goes low and the transfer ends when ss goes high after eight clock cycles on sck. when cpha is 1, a transfer is said to begin the first time sck becomes active while ss is low and the transfer ends when the spif flag gets set. clearing the wcol bit is accomplished by reading t he spsr (with wcol set) followed by an access to spdr. modf ? mode fault the mode fault flag indicates that there may have been a multi-master conflict for system control and allows a proper exit from system operation to a reset or default system state. the modf bit is normally clear, and is set only when the master device has its ss pin pulled low. setting the modf bit affects the internal serial peripheral inte rface system in the following ways. 1. an spi interrupt is generated if spie = 1. 2. the spe bit is cleared. this disables the spi. 3. the mstr bit is cleared, thus fo rcing the device into the slave mode. table 10-1. spi clock rate selection spr[1:0] spi clock rate 00 internal clock 2 01 internal clock 4 10 internal clock 16 11 internal clock 32 $000bbit 7654321bit 0 read: spif wcol modf write: reset:00000000 = unimplemented figure 10-5. spi status register
spi registers mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 77 clearing the modf bit is accomplished by reading th e spsr (with modf set), followed by a write to the spcr. control bits spe and mstr may be restored by user software to t heir original state during this clearing sequence or after the modf bit has been cleared. when configured as an mc68hc05c9a, it is also necessary to restore ddrd after a mode fault. bits 5 and 3?0 ? not implemented these bits always read 0. 10.5.3 serial peripheral data i/o register the serial peripheral data i/o register (spdr), shown in figure 10-6 , is used to transmit and receive data on the serial bus. only a write to this register will in itiate transmission/reception of another byte and this will only occur in the master device. at the completion of transmitting a byte of data, the spif status bit is set in both the master and slave devices. when the user reads the serial peripheral data i/o r egister, a buffer is actually being read. the first spif must be cleared by the time a second transfer of the data from the shift register to the read buffer is initiated or an overrun condition will exist. in cases of overrun, the byte which causes the overrun is lost. a write to the serial peripheral data i/o register is not buffered and places data directly into the shift register for transmission. $000cbit 7654321bit 0 read: spd7 spd6 spd5 spd4 spd3 spd2 spd1 spd0 write: reset: unaffected by reset figure 10-6. pi data register (spdr)
serial peripheral interface (spi) mc68hc05c9a advance informati on data sheet, rev. 4.1 78 freescale semiconductor
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 79 chapter 11 instruction set 11.1 introduction the microcontroller unit (mcu) instruction set has 62 instructions and uses eight addressing modes. the instructions include all those of the m146805 cmos (c omplementary metal oxide silicon) family plus one more: the unsigned multiply (mul) instruction. the mu l instruction allows unsigned multiplication of the contents of the accumulator (a) and the index register (x). the high-order product is stored in the index register, and the low-order product is stored in the accumulator. 11.2 addressing modes the central processor unit (cpu) uses eight addressi ng modes for flexibility in accessing data. the addressing modes provide eight different ways for the cpu to find the data required to execute an instruction. the eight addressing modes are:  inherent immediate direct  extended  indexed, no offset  indexed, 8-bit offset  indexed, 16-bit offset  relative 11.2.1 inherent inherent instructions are those that have no operand, such as return from interrupt (rti) and stop (stop). some of the inherent instructions act on data in th e cpu registers, such as set carry flag (sec) and increment accumulator (inca). inherent instructions require no operand address and are one byte long. 11.2.2 immediate immediate instructions are those that contain a value to be used in an operation with the value in the accumulator or index register. immediate instruct ions require no operand addres s and are two bytes long. the opcode is the first byte, and the i mmediate data value is the second byte. 11.2.3 direct direct instructions can access any of the first 256 me mory locations with two byte s. the first byte is the opcode, and the second is the low byte of the operand address. in direct addressing, the cpu automatically uses $00 as the high byte of the operand address.
instruction set mc68hc05c9a advance informati on data sheet, rev. 4.1 80 freescale semiconductor 11.2.4 extended extended instructions use three bytes and can access any address in memory. the first byte is the opcode; the second and third bytes are the high and low bytes of the operand address. when using the freescale assembler, the programmer does not need to specify whether an instruction is direct or extended. the assembler automatically selects the shortest form of the instruction. 11.2.5 indexed, no offset indexed instructions with no offset are 1-byte inst ructions that can access data with variable addresses within the first 256 memory locations. the index register contains the low byte of the effective address of the operand. the cpu automatically uses $00 as t he high byte, so these instructions can address locations $0000?$00ff. indexed, no offset instructions are often used to move a pointer through a table or to hold the address of a frequently used random-access memory (ram) or input/output (i/o) location. 11.2.6 indexed, 8-bit offset indexed, 8-bit offset instructions are 2-byte instru ctions that can access data with variable addresses within the first 511 memo ry locations. the cpu adds the unsigned byte in the index register to the unsigned byte following the opcode. the sum is the e ffective address of the operand. these instructions can access locations $0000?$01fe. indexed 8-bit offset instructions are useful for selecting the kth element in an n-element table. the table can begin anywhere within the first 256 memory lo cations and could extend as far as location 510 ($01fe). the k value is typically in the index regist er, and the address of the beginning of the table is in the byte following the opcode. 11.2.7 indexed, 16-bit offset indexed, 16-bit offset instructions are 3-byte instruct ions that can access data with variable addresses at any location in memory. the cpu adds the unsigned by te in the index register to the two unsigned bytes following the opcode. the sum is the effective addres s of the operand. the first byte after the opcode is the high byte of the 16-bit offset; the second byte is the low byte of the offset. indexed, 16-bit offset instructions are useful for se lecting the kth element in an n-element table anywhere in memory. as with direct and extended address ing, the freescale assembler determines the shortest form of indexed addressing. 11.2.8 relative relative addressing is only for branch instructions. if the branch condition is true, the cpu finds the effective branch destination by adding the signed byte following the opcode to the contents of the program counter. if the branch condition is not true, the cpu goes to the next instruction. the offset is a signed, two?s complement byte that gives a branching range of ?128 to +127 bytes from the address of the next location after the branch instruction. when using the freescale assembler, the programmer does not need to calculate the offset, because the assembler determines the proper offset and verifies that it is within the span of the branch.
instruction types mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 81 11.3 instruction types the mcu instructions fall into the following five categories:  register/memory instructions  read-modify-write instructions  jump/branch instructions  bit manipulation instructions  control instructions 11.3.1 register/memory instructions these instructions operate on cpu registers and memo ry locations. most of them use two operands. one operand is in either the accumulator or the index r egister. the cpu finds the other operand in memory. table 11-1. register/memory instructions instruction mnemonic add memory byte and carry bit to accumulator adc add memory byte to accumulator add and memory byte with accumulator and bit test accumulator bit compare accumulator cmp compare index register with memory byte cpx exclusive or accumulator with memory byte eor load accumulator with memory byte lda load index register with memory byte ldx multiply mul or accumulator with memory byte ora subtract memory byte and carry bit from accumulator sbc store accumulator in memory sta store index register in memory stx subtract memory byte from accumulator sub
instruction set mc68hc05c9a advance informati on data sheet, rev. 4.1 82 freescale semiconductor 11.3.2 read-modify-w rite instructions these instructions read a memory location or a regist er, modify its contents, and write the modified value back to the memory location or to the register. note do not use read-modify-write operations on write-only registers. table 11-2. read-modify-write instructions instruction mnemonic arithmetic shift left (same as lsl) asl arithmetic shift right asr bit clear bclr (1) 1. unlike other read-modify-wri te instructions, bclr and bset use only direct addressing. bit set bset (1) clear register clr complement (one?s complement) com decrement dec increment inc logical shift left (same as asl) lsl logical shift right lsr negate (two?s complement) neg rotate left through carry bit rol rotate right through carry bit ror test for negative or zero tst (2) 2. tst is an exception to the read-modify-write sequence because it does not write a replacement value.
instruction types mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 83 11.3.3 jump/branch instructions jump instructions allow the cpu to interrupt the normal sequence of the program counter. the unconditional jump instruction (jmp) and the jump-to-subroutine instruction (jsr) have no register operand. branch instructions allow the cpu to interrupt the normal sequence of the program counter when a test condition is met. if the test condition is not met, the branch is not performed. the brclr and brset instructions cause a branch bas ed on the state of any readable bit in the first 256 memory locations. these 3-byte instructions use a combination of direct addressing and relative addressing. the direct address of the byte to be test ed is in the byte following the opcode. the third byte is the signed offset byte. the cpu finds the effective branch destination by adding the third byte to the program counter if the specified bit tests true. the bit to be tested and its condition (set or clear) is part of the opcode. the span of branching is from ?128 to +127 from the address of the next location after the branch instruction. the cpu also transfers the test ed bit to the carry/borrow bit of the condition code register. table 11-3. jump and branch instructions instruction mnemonic branch if carry bit clear bcc branch if carry bit set bcs branch if equal beq branch if half-carry bit clear bhcc branch if half-carry bit set bhcs branch if higher bhi branch if higher or same bhs branch if irq pin high bih branch if irq pin low bil branch if lower blo branch if lower or same bls branch if interrupt mask clear bmc branch if minus bmi branch if interrupt mask set bms branch if not equal bne branch if plus bpl branch always bra branch if bit clear brclr branch never brn branch if bit set brset branch to subroutine bsr unconditional jump jmp jump to subroutine jsr
instruction set mc68hc05c9a advance informati on data sheet, rev. 4.1 84 freescale semiconductor 11.3.4 bit manipul ation instructions the cpu can set or clear any writable bit in the fi rst 256 bytes of memory, which includes i/o registers and on-chip ram locations. the cpu can also test and branch based on the state of any bit in any of the first 256 memory locations. 11.3.5 control instructions these instructions act on cpu registers and control cpu operation during program execution. table 11-4. bit manipulation instructions instruction mnemonic bit clear bclr branch if bit clear brclr branch if bit set brset bit set bset table 11-5. control instructions instruction mnemonic clear carry bit clc clear interrupt mask cli no operation nop reset stack pointer rsp return from interrupt rti return from subroutine rts set carry bit sec set interrupt mask sei stop oscillator and enable irq pin stop software interrupt swi transfer accumulator to index register tax transfer index register to accumulator txa stop cpu clock and enable interrupts wait
instruction set summary mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 85 11.4 instruction set summary table 11-6. instruction se t summary (sheet 1 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc adc # opr adc opr adc opr adc opr ,x adc opr ,x adc ,x add with carry a (a) + (m) + (c)  ?  imm dir ext ix2 ix1 ix a9 b9 c9 d9 e9 f9 ii dd hh ll ee ff ff 2 3 4 5 4 3 add # opr add opr add opr add opr ,x add opr ,x add ,x add without carry a (a) + (m)  ?  imm dir ext ix2 ix1 ix ab bb cb db eb fb ii dd hh ll ee ff ff 2 3 4 5 4 3 and # opr and opr an d opr and opr ,x and opr ,x and ,x logical and a (a) (m) ? ?  ? imm dir ext ix2 ix1 ix a4 b4 c4 d4 e4 f4 ii dd hh ll ee ff ff 2 3 4 5 4 3 asl opr asla aslx asl opr ,x asl ,x arithmetic shift left (same as lsl) ? ?  dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 asr opr asra asrx asr opr ,x asr ,x arithmetic shift right ? ?  dir inh inh ix1 ix 37 47 57 67 77 dd ff 5 3 3 6 5 bcc rel branch if carry bit clear pc (pc) + 2 + rel ? c = 0 ????? rel 24 rr 3 bclr n opr clear bit n mn 0 ????? dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 11 13 15 17 19 1b 1d 1f dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bcs rel branch if carry bit set (same as blo) pc (pc) + 2 + rel ? c = 1 ????? rel 25 rr 3 beq rel branch if equal pc (pc) + 2 + rel ? z = 1 ????? rel 27 rr 3 bhcc rel branch if half-carry bit clear pc (pc) + 2 + rel ? h = 0 ????? rel 28 rr 3 bhcs rel branch if half-carry bit set pc (pc) + 2 + rel ? h = 1 ????? rel 29 rr 3 bhi rel branch if higher pc (pc) + 2 + rel ? c z = 0 ????? rel 22 rr 3 bhs rel branch if higher or same pc (pc) + 2 + rel ? c = 0 ????? rel 24 rr 3 bih rel branch if irq pin high pc (pc) + 2 + rel ? irq = 1 ????? rel 2f rr 3 bil rel branch if irq pin low pc (pc) + 2 + rel ? irq = 0 ????? rel 2e rr 3 c b0 b7 0 b0 b7 c
instruction set mc68hc05c9a advance informati on data sheet, rev. 4.1 86 freescale semiconductor bit # opr bit opr bit opr bit opr ,x bit opr ,x bit ,x bit test accumulator with memory byte (a) (m) ? ?  ? imm dir ext ix2 ix1 ix a5 b5 c5 d5 e5 f5 ii dd hh ll ee ff ff 2 3 4 5 4 3 blo rel branch if lower (same as bcs) pc (pc) + 2 + rel ? c = 1 ????? rel 25 rr 3 bls rel branch if lower or same pc (pc) + 2 + rel ? c z = 1 ????? rel 23 rr 3 bmc rel branch if interrupt mask clear pc (pc) + 2 + rel ? i = 0 ????? rel 2c rr 3 bmi rel branch if minus pc (pc) + 2 + rel ? n = 1 ????? rel 2b rr 3 bms rel branch if interrupt mask set pc (pc) + 2 + rel ? i = 1 ????? rel 2d rr 3 bne rel branch if not equal pc (pc) + 2 + rel ? z = 0 ????? rel 26 rr 3 bpl rel branch if plus pc (pc) + 2 + rel ? n = 0 ????? rel 2a rr 3 bra rel branch always pc (pc) + 2 + rel ? 1 = 1 ????? rel 20 rr 3 brclr n opr rel branch if bit n clear pc (pc) + 2 + rel ? mn = 0 ????  dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 01 03 05 07 09 0b 0d 0f dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 brn rel branch never pc (pc) + 2 + rel ? 1 = 0 ????? rel 21 rr 3 brset n opr rel branch if bit n set pc (pc) + 2 + rel ? mn = 1 ????  dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 00 02 04 06 08 0a 0c 0e dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 bset n opr set bit n mn 1 ????? dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 10 12 14 16 18 1a 1c 1e dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bsr rel branch to subroutine pc (pc) + 2; push (pcl) sp (sp) ? 1; push (pch) sp (sp) ? 1 pc (pc) + rel ????? rel ad rr 6 clc clear carry bit c 0 ???? 0 inh 98 2 cli clear interrupt mask i 0 ? 0 ??? inh 9a 2 table 11-6. instruction se t summary (sheet 2 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc
instruction set summary mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 87 clr opr clra clrx clr opr ,x clr ,x clear byte m $00 a $00 x $00 m $00 m $00 ?? 0 1 ? dir inh inh ix1 ix 3f 4f 5f 6f 7f dd ff 5 3 3 6 5 cmp # opr cmp opr cmp opr cmp opr ,x cmp opr ,x cmp ,x compare accumulator with memory byte (a) ? (m) ? ?  imm dir ext ix2 ix1 ix a1 b1 c1 d1 e1 f1 ii dd hh ll ee ff ff 2 3 4 5 4 3 com opr coma comx com opr ,x com ,x complement byte (one?s complement) m (m ) = $ff ? (m) a (a ) = $ff ? (a) x (x ) = $ff ? (x) m (m ) = $ff ? (m) m (m ) = $ff ? (m) ??  1 dir inh inh ix1 ix 33 43 53 63 73 dd ff 5 3 3 6 5 cpx # opr cpx opr cpx opr cpx opr ,x cpx opr ,x cpx ,x compare index register with memory byte (x) ? (m) ? ?  imm dir ext ix2 ix1 ix a3 b3 c3 d3 e3 f3 ii dd hh ll ee ff ff 2 3 4 5 4 3 dec opr deca decx dec opr ,x dec ,x decrement byte m (m) ? 1 a (a) ? 1 x (x) ? 1 m (m) ? 1 m (m) ? 1 ??  ? dir inh inh ix1 ix 3a 4a 5a 6a 7a dd ff 5 3 3 6 5 eor # opr eor opr eor opr eor opr ,x eor opr ,x eor ,x exclusive or accumulator with memory byte a (a) (m) ? ?  ? imm dir ext ix2 ix1 ix a8 b8 c8 d8 e8 f8 ii dd hh ll ee ff ff 2 3 4 5 4 3 inc opr inca incx inc opr ,x inc ,x increment byte m (m) + 1 a (a) + 1 x (x) + 1 m (m) + 1 m (m) + 1 ??  ? dir inh inh ix1 ix 3c 4c 5c 6c 7c dd ff 5 3 3 6 5 jmp opr jmp opr jmp opr ,x jmp opr ,x jmp ,x unconditional jump pc jump address ????? dir ext ix2 ix1 ix bc cc dc ec fc dd hh ll ee ff ff 2 3 4 3 2 jsr opr jsr opr jsr opr ,x jsr opr ,x jsr ,x jump to subroutine pc (pc) + n (n = 1, 2, or 3) push (pcl); sp (sp) ? 1 push (pch); sp (sp) ? 1 pc effective address ????? dir ext ix2 ix1 ix bd cd dd ed fd dd hh ll ee ff ff 5 6 7 6 5 table 11-6. instruction se t summary (sheet 3 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc
instruction set mc68hc05c9a advance informati on data sheet, rev. 4.1 88 freescale semiconductor lda # opr lda opr lda opr lda opr ,x lda opr ,x lda ,x load accumulator with memory byte a (m) ? ?  ? imm dir ext ix2 ix1 ix a6 b6 c6 d6 e6 f6 ii dd hh ll ee ff ff 2 3 4 5 4 3 ldx # opr ldx opr ldx opr ldx opr ,x ldx opr ,x ldx ,x load index register with memory byte x (m) ? ?  ? imm dir ext ix2 ix1 ix ae be ce de ee fe ii dd hh ll ee ff ff 2 3 4 5 4 3 lsl opr lsla lslx lsl opr ,x lsl ,x logical shift left (same as asl) ? ?  dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 lsr opr lsra lsrx lsr opr ,x lsr ,x logical shift right ? ? 0  dir inh inh ix1 ix 34 44 54 64 74 dd ff 5 3 3 6 5 mul unsigned multiply x : a (x) (a) 0 ??? 0 inh 42 1 1 neg opr nega negx neg opr ,x neg ,x negate byte (two?s complement) m ?(m) = $00 ? (m) a ?(a) = $00 ? (a) x ?(x) = $00 ? (x) m ?(m) = $00 ? (m) m ?(m) = $00 ? (m) ??  dir inh inh ix1 ix 30 40 50 60 70 dd ff 5 3 3 6 5 nop no operation ????? inh 9d 2 ora # opr ora opr ora opr ora opr ,x ora opr ,x ora ,x logical or accumulator with memory a (a) (m) ? ?  ? imm dir ext ix2 ix1 ix aa ba ca da ea fa ii dd hh ll ee ff ff 2 3 4 5 4 3 rol opr rola rolx rol opr ,x rol ,x rotate byte left through carry bit ? ?  dir inh inh ix1 ix 39 49 59 69 79 dd ff 5 3 3 6 5 ror opr rora rorx ror opr ,x ror ,x rotate byte right through carry bit ? ?  dir inh inh ix1 ix 36 46 56 66 76 dd ff 5 3 3 6 5 rsp reset stack pointer sp $00ff ? ???? inh 9c 2 table 11-6. instruction se t summary (sheet 4 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc c b0 b7 0 b0 b7 c 0 c b0 b7 b0 b7 c
instruction set summary mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 89 rti return from interrupt sp (sp) + 1; pull (ccr) sp (sp) + 1; pull (a) sp (sp) + 1; pull (x) sp (sp) + 1; pull (pch) sp (sp) + 1; pull (pcl)  inh 80 9 rts return from subroutine sp (sp) + 1; pull (pch) sp (sp) + 1; pull (pcl) ????? inh 81 6 sbc # opr sbc opr sbc opr sbc opr ,x sbc opr ,x sbc ,x subtract memory byte and carry bit from accumulator a (a) ? (m) ? (c) ? ?  imm dir ext ix2 ix1 ix a2 b2 c2 d2 e2 f2 ii dd hh ll ee ff ff 2 3 4 5 4 3 sec set carry bit c 1 ???? 1 inh 99 2 sei set interrupt mask i 1 ? 1 ??? inh 9b 2 sta opr sta opr sta opr ,x sta opr ,x sta ,x store accumulator in memory m (a) ? ?  ? dir ext ix2 ix1 ix b7 c7 d7 e7 f7 dd hh ll ee ff ff 4 5 6 5 4 stop stop oscillator and enable irq pin ? 0 ? ? ? inh 8e 2 stx opr stx opr stx opr ,x stx opr ,x stx ,x store index register in memory m (x) ? ?  ? dir ext ix2 ix1 ix bf cf df ef ff dd hh ll ee ff ff 4 5 6 5 4 sub # opr sub opr sub opr sub opr ,x sub opr ,x sub ,x subtract memory byte from accumulator a (a) ? (m) ? ?  imm dir ext ix2 ix1 ix a0 b0 c0 d0 e0 f0 ii dd hh ll ee ff ff 2 3 4 5 4 3 swi software interrupt pc (pc) + 1; push (pcl) sp (sp) ? 1; push (pch) sp (sp) ? 1; push (x) sp (sp) ? 1; push (a) sp (sp) ? 1; push (ccr) sp (sp) ? 1; i 1 pch interrupt vector high byte pcl interrupt vector low byte ? 1 ??? inh 83 1 0 tax transfer accumulator to index register x (a) ????? inh 97 2 tst opr tsta tstx tst opr ,x tst ,x test memory byte for negative or zero (m) ? $00 ? ?  ? dir inh inh ix1 ix 3d 4d 5d 6d 7d dd ff 4 3 3 5 4 table 11-6. instruction se t summary (sheet 5 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc
instruction set mc68hc05c9a advance informati on data sheet, rev. 4.1 90 freescale semiconductor 11.5 opcode map see table 11-7 . txa transfer index register to accumulator a (x) ????? inh 9f 2 wait stop cpu clock and enable interrupts ? 0 ? ? ? inh 8f 2 a accumulator opr operand (one or two bytes) c carry/borrow flag pc program counter ccr condition code register pch p rogram counter high byte dd direct address of operand pcl program counter low byte dd rr direct address of operand and relative offset of branch instruction rel relative addressing mode dir direct addressing mode rel relative program counter offset byte ee ff high and low bytes of offset in indexed, 16-bit o ffset addressing rr relative pr ogram counter offset byte ext extended addressing mode sp stack pointer ff offset byte in indexed, 8-bit offset addressing x index register h half-carry flag z zero flag hh ll high and low bytes of operand address in extended addressing # immediate value i interrupt mask logical and ii immediate operand byte logical or imm immediate addressing mode logical exclusive or inh inherent addressing mode ( ) contents of ix indexed, no offset addressing mode ?( ) negation (two?s complement) ix1 indexed, 8-bit offset addressing mode loaded with ix2 indexed, 16-bit offset addressing mode ? if m memory location : concatenated with n negative flag  set or cleared n any bit ? not affected table 11-6. instruction se t summary (sheet 6 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc
mc68hc05c9a advance information data sheet, rev. 4.1 freescale semiconductor 91 opcode map table 11-7. opcode map bit manipulation branch read-modif y-write control register/memory dir dir rel dir inh inh ix1 ix inh inh imm dir ext ix2 ix1 ix 0123456789abcdef 0 5 brset0 3dir 5 bset0 2dir 3 bra 2rel 5 neg 2dir 3 nega 1inh 3 negx 1inh 6 neg 2ix1 5 neg 1ix 9 rti 1inh 2 sub 2imm 3 sub 2dir 4 sub 3 ext 5 sub 3ix2 4 sub 2ix1 3 sub 1ix 0 1 5 brclr0 3dir 5 bclr0 2dir 3 brn 2rel 6 rts 1inh 2 cmp 2imm 3 cmp 2dir 4 cmp 3 ext 5 cmp 3ix2 4 cmp 2ix1 3 cmp 1ix 1 2 5 brset1 3dir 5 bset1 2dir 3 bhi 2rel 11 mul 1inh 2 sbc 2imm 3 sbc 2dir 4 sbc 3 ext 5 sbc 3ix2 4 sbc 2ix1 3 sbc 1ix 2 3 5 brclr1 3dir 5 bclr1 2dir 3 bls 2rel 5 com 2dir 3 coma 1inh 3 comx 1inh 6 com 2ix1 5 com 1ix 10 swi 1inh 2 cpx 2imm 3 cpx 2dir 4 cpx 3 ext 5 cpx 3ix2 4 cpx 2ix1 3 cpx 1ix 3 4 5 brset2 3dir 5 bset2 2dir 3 bcc 2rel 5 lsr 2dir 3 lsra 1inh 3 lsrx 1inh 6 lsr 2ix1 5 lsr 1ix 2 and 2imm 3 and 2dir 4 and 3 ext 5 and 3ix2 4 and 2ix1 3 and 1ix 4 5 5 brclr2 3dir 5 bclr2 2dir 3 bcs/blo 2rel 2 bit 2imm 3 bit 2dir 4 bit 3 ext 5 bit 3ix2 4 bit 2ix1 3 bit 1ix 5 6 5 brset3 3dir 5 bset3 2dir 3 bne 2rel 5 ror 2dir 3 rora 1inh 3 rorx 1inh 6 ror 2ix1 5 ror 1ix 2 lda 2imm 3 lda 2dir 4 lda 3 ext 5 lda 3ix2 4 lda 2ix1 3 lda 1ix 6 7 5 brclr3 3dir 5 bclr3 2dir 3 beq 2rel 5 asr 2dir 3 asra 1inh 3 asrx 1inh 6 asr 2ix1 5 asr 1ix 2 ta x 1inh 4 sta 2dir 5 sta 3 ext 6 sta 3ix2 5 sta 2ix1 4 sta 1ix 7 8 5 brset4 3dir 5 bset4 2dir 3 bhcc 2rel 5 asl/lsl 2dir 3 asla/lsla 1inh 3 aslx/lslx 1inh 6 asl/lsl 2ix1 5 asl/lsl 1ix 2 clc 1inh 2 eor 2imm 3 eor 2dir 4 eor 3 ext 5 eor 3ix2 4 eor 2ix1 3 eor 1ix 8 9 5 brclr4 3dir 5 bclr4 2dir 3 bhcs 2rel 5 rol 2dir 3 rola 1inh 3 rolx 1inh 6 rol 2ix1 5 rol 1ix 2 sec 1inh 2 adc 2imm 3 adc 2dir 4 adc 3 ext 5 adc 3ix2 4 adc 2ix1 3 adc 1ix 9 a 5 brset5 3dir 5 bset5 2dir 3 bpl 2rel 5 dec 2dir 3 deca 1inh 3 decx 1inh 6 dec 2ix1 5 dec 1ix 2 cli 1inh 2 ora 2imm 3 ora 2dir 4 ora 3 ext 5 ora 3ix2 4 ora 2ix1 3 ora 1ix a b 5 brclr5 3dir 5 bclr5 2dir 3 bmi 2rel 2 sei 1inh 2 add 2imm 3 add 2dir 4 add 3 ext 5 add 3ix2 4 add 2ix1 3 add 1ix b c 5 brset6 3dir 5 bset6 2dir 3 bmc 2rel 5 inc 2dir 3 inca 1inh 3 incx 1inh 6 inc 2ix1 5 inc 1ix 2 rsp 1inh 2 jmp 2dir 3 jmp 3 ext 4 jmp 3ix2 3 jmp 2ix1 2 jmp 1ix c d 5 brclr6 3dir 5 bclr6 2dir 3 bms 2rel 4 tst 2dir 3 tsta 1inh 3 tstx 1inh 5 tst 2ix1 4 tst 1ix 2 nop 1inh 6 bsr 2rel 5 jsr 2dir 6 jsr 3 ext 7 jsr 3ix2 6 jsr 2ix1 5 jsr 1ix d e 5 brset7 3dir 5 bset7 2dir 3 bil 2rel 2 stop 1inh 2 ldx 2imm 3 ldx 2dir 4 ldx 3 ext 5 ldx 3ix2 4 ldx 2ix1 3 ldx 1ix e f 5 brclr7 3dir 5 bclr7 2dir 3 bih 2rel 5 clr 2dir 3 clra 1inh 3 clrx 1inh 6 clr 2ix1 5 clr 1ix 2 wait 1inh 2 txa 1inh 4 stx 2dir 5 stx 3 ext 6 stx 3ix2 5 stx 2ix1 4 stx 1ix f inh = inherent rel = relative imm = immediate ix = indexed, no offset dir = direct ix1 = indexed, 8-bit offset ext = extended ix2 = indexed, 16-bit offset 0 msb of opcode in hexadecimal lsb of opcode in hexadecimal 0 5 brset0 3dir number of cycles opcode mnemonic number of bytes/addressing mode lsb msb lsb msb lsb msb
instruction set mc68hc05c9a advance informati on data sheet, rev. 4.1 92 freescale semiconductor
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 93 chapter 12 electrical specifications 12.1 maximum ratings maximum ratings are the extreme limits to which the mcu can be exposed without permanently damaging it. the mcu contains circuitry to protect the inputs against damage from high static voltages; however, do not apply voltages higher than those shown in the table below. keep v in and v out within the range v ss (v in or v out ) v dd . connect unused inputs to the appropriate voltage level, either v ss or v dd . note this device is not guaranteed to operate properly at the maximum ratings. refer to 12.5 5.0-vdc electrical characteristics for guaranteed operating conditions. 12.2 operating temperature 12.3 thermal characteristics rating symbol value unit supply voltage v dd ?0.3 to +7.0 v input voltage normal operation bootloader mode (irq pin only) v in v ss ?0.3 to v dd + 0.3 v ss ?0.3 to 2 x v dd + 0.3 v current drain per pin (excluding v dd and v ss ) i25ma storage temperature range t stg ?65 to +150 c characteristic symbol value unit operating temperature range t a ?40 to +85 c characteristic symbol value unit thermal resistance plastic dual in-line (pdip) ja 60 c/w thermal resistance plastic leaded chip carrier (plcc) ja 70 c/w thermal resistance quad flat pack (qfp) ja 95 c/w thermal resistance plastic shrink dip (sdip) ja 60 c/w
electrical specifications mc68hc05c9a advance informati on data sheet, rev. 4.1 94 freescale semiconductor 12.4 power considerations the average chip-junction temperature, t j , in c, can be obtained from: t j = t a + (p d ja ) (1) where: t a = ambient temperature, c ja = package thermal resistance, junction to ambient, c/w p d = p int + p i / o p int = i dd v dd watts (chip internal power) p i / o = power dissipation on input and output pins (user determined) for most applications p i / o ? p int and can be neglected. the following is an approximate relationship between p d and t j (neglecting p j ): p d = k (t j + 273 c) (2) solving equations (1) and (2) for k gives: k = p d (t a + 273 c) + ja (p d ) 2 (3) where k is a constant pertaining to the particular part. k can be determined from equation (3) by measuring p d (at equilibrium) for a known t a . using this value of k, the values of p d and t j can be obtained by solving equations (1) and (2) iteratively for any value of t a . figure 12-1. test load v dd c r2 r1 test point (see table) (see table) see table v dd = 4.5 v pins r1 r2 c pa7?pa0 pb7?pb0 pc7?pc0 pd5?pd0, pd7 3.26 ? 2.38 ? 50 pf v dd = 3.0 v pins r1 r2 c pa7?pa0 pb7?pb0 pc7?pc0 pd5?pd0, pd7 10.91 ? 6.32 ? 50 pf
5.0-vdc electrical characteristics mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 95 12.5 5.0-vdc electrical characteristics characteristic (1) 1. v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = ?40 to +85 c, unless otherwise noted symbol min typ (2) 2. typical values reflect measurements taken on average processed devices at the midpoint of voltage range, 25 c only. max unit output voltage i l oad = 10.0 a i l oad = ?10.0 a v ol v oh ? v dd ?0.1 ? ? 0.1 ? v output high voltage (i l oad = ?0.8 ma) pa7?pa0, pb7?pb0, pc6?pc0, tcmp, pd7, pd0 (i l oad = ?1.6 ma) pd5?pd1 (i l oad = ?5.0 ma) pc7 v oh v dd ?0.8 v dd ?0.8 v dd ?0.8 ? ? ? ? ? ? v output low voltage (i l oad = 1.6 ma) pa7?pa0, pb7?pb0, pc6?pc0, pd7, pd5?pd0, tcmp (i l oad = 10 ma) pc7 v ol ? ? ? ? 0.4 0.4 v input high voltage pa7?pa0, pb7?pb0, pc7?pc0, pd7, pd5?pd0, tcap, irq , reset , osc1 v ih 0.7 v dd ? v dd v input low voltage pa7?pa0, pb7?pb0, pc7?pc0, pd7, pd5?pd0, tcap, irq , reset , osc1 v il v ss ? 0.2 v dd v supply current (4.5?5.5 vdc @ f op = 2.1 mhz) run (3) wait (4) stop (5) 25 c ?40 to 85 c 3. run (operating) i dd measured using external square wave clock sour ce; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ?0.2 v; no dc loads; less than 50 pf on all outputs; c l = 20 pf on osc2 4. wait i dd measured using external square wave clock source ; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ?0.2 v; no dc loads; less than 50 pf on all outputs; c l = 20 pf on osc2. wait i dd is affected linearly by the osc2 capacitance. 5. stop i dd measured with osc1 = 0.2 v; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ?0.2 v. i dd ? ? ? ? 3.5 1.0 1.0 7.0 5.25 3.25 20.0 50.0 ma ma a a i/o ports hi-z leakage current pa7?pa0, pb7?pb0 (without pullup) pc7?pc0, pd7, pd5?pd0 i oz ??10 a input current reset , irq , osc1, tcap, pd7, pd5?pd0 i in ?? 1 a input pullup current (6) pb7?pb0 (with pullup) 6. input pullup current measured with v il = 0.2 v. i in 5?60 a capacitance ports (as input or output) reset , irq , osc1, tcap, pd7, pd5, pd0 c out c in ? ? ? ? 12 8 pf programming voltage (25 c) v pp 15.0 16.0 17.0 v programming current (25 c) i pp ??200ma
electrical specifications mc68hc05c9a advance informati on data sheet, rev. 4.1 96 freescale semiconductor 12.6 3.3-vdc electrical characteristics characteristic (1) 1. v dd = 3.3 vdc 0.3 vdc, v ss = 0 vdc, t a = ?40 to +85 c, unless otherwise noted symbol min typ (2) 2. typical values reflect measurements taken on average processed devices at the midpoint of voltage range, 25 c only. max unit output voltage i l oad = 10.0 a i l oad = ?10.0 a v ol v oh ? v dd ?0.1 ? ? 0.1 ? v output high voltage (i l oad = ?0.2 ma) pa7?pa0, pb7?pb0, pc6?pc0, tcmp, pd7, pd0 (i l oad = ?0.4 ma) pd5?pd1 (i l oad = ?1.5 ma) pc7 v oh v dd ?0.3 v dd ?0.3 v dd ?0.3 ? ? ? ? ? ? v output low voltage (i l oad = 0.4ma) pa7?pa0, pb7?pb0, pc6?pc0, pd7, pd5?pd0, tcmp (i l oad = 6 ma) pc7 v ol ? ? ? ? 0.3 0.3 v input high voltage pa7?pa0, pb7?pb0, pc7?pc0, pd7, pd5?pd0, tcap, irq , reset , osc1 v ih 0.7 v dd ? v dd v input low voltage pa7?pa0, pb7?pb0, pc7?pc0, pd7, pd5?pd0, tcap, irq , reset , osc1 v il v ss ? 0.2 v dd v supply current (3.0?3.6 vdc @ f op = 1.0 mhz) run (3) wait (4) stop (5) 25 c ?40 to 85 c 3. run (operating) i dd measured using external square wave clock source; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ?0.2 v; no dc loads; less th an 50 pf on all outputs; c l = 20 pf on osc2 4. wait i dd measured using external square wave clock source ; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ?0.2 v; no dc loads; less than 50 pf on all outputs; c l = 20 pf on osc2. wait i dd is affected linearly by the osc2 capacitance. 5. stop i dd measured with osc1 = 0.2 v; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ?0.2 v. i dd ? ? ? ? 1.0 500 1.0 2.5 1.6 900 8 20 ma a a a i/o ports hi-z leakage current pa7?pa0, pb7?pb0 (without pullup) pc7?pc0, pd7, pd5?pd0 i oz ??10 a input current reset , irq , osc1, tcap, pd7, pd5?pd0 i in ?? 1 a input pullup current (6) pb7?pb0 (with pullup) 6. input pullup current measured with v il = 0.2 v. i in 0.5 ? 20 a capacitance ports (as input or output) reset , irq , osc1, tcap, pd7, pd5, pd0 c out c in ? ? ? ? 12 8 pf
3.3-vdc electrical characteristics mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 97 figure 12-2. maximum supply current vs internal clock frequency, v dd = 5.5 v figure 12-3. maximum supply current vs internal clock frequency, v dd = 3.6 v 1.00 ma 2.00 ma 3.00 ma 4.00 ma 5.00 ma 1.5 mhz 2.0 mhz 0.5 mhz 1.0 mhz internal clock frequency (xtal 2) supply current (i dd ) 50 astop i dd w a i t i d d r u n ( o p e r a t i n g ) i d d (mhz) v dd = 5.5 v t = ?40 to 85 500 ma 1.00 ma 1.50 ma 0.5 mhz 1.0 mhz supply current (i dd ) w a i t i d d r u n ( op e r a t i n g) i d d v dd = 3.6 v t = ?40 to 85 stop i dd
electrical specifications mc68hc05c9a advance informati on data sheet, rev. 4.1 98 freescale semiconductor 12.7 5.0-vdc control timing characteristic (1) 1. v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = ?40 to +85 c, unless otherwise noted symbol min max unit frequency of operation crystal external clock f osc ? dc 4.2 4.2 mhz internal pperating frequency (f osc 2) crystal external clock f op ? dc 2.1 2.1 mhz cycle time t cyc 480 ? ns crystal oscillator startup time t oxov ?100ms stop recovery startup time (crystal oscillator) t ilch ?100ms reset pulse width t rl 1.5 ? t cyc timer resolution (2) input capture pulse width input capture pulse period 2. because a 2-bit prescaler in the ti mer must count four internal cycles (t cyc ), this is the limiting minimum factor in determining the timer resolution. t resl t th , t tl t tltl 4.0 125 (3) 3. the minimum period t tltl should not be less than the number of cycle times it takes to execute the capture interrupt service routine plus 24 t cyc . ? ? ? t cyc ns t cyc interrupt pulse width low (edge-triggered) t ilih 125 ? ns interrupt pulse period t ilil (4) 4. the minimum t ilil should not be less than the number of cycle times it takes to execute the interrupt service routine plus 19 t cyc . ? t cyc osc1 pulse width t oh ,t ol 90 ? ns
3.3-vdc control timing mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 99 12.8 3.3-vdc control timing figure 12-4. tcap timing relationships characteristic (1) 1. v dd = 3.3vdc 0.3 vdc, v ss = 0 vdc, t a = ?40 to +85 c, unless otherwise noted symbol min max unit frequency of operation crystal external clock f osc ? dc 2.0 2.0 mhz internal operating frequency (f osc 2) crystal external clock f op ? dc 1.0 1.0 mhz cycle time t cyc 1000 ? ns crystal oscillator startup time t oxov ?100ms stop recovery startup time (crystal oscillator) t ilch ?100ms reset pulse width t rl 1.5 ? t cyc timer resolution (2) input capture pulse width input capture pulse period 2. because a 2-bit prescaler in the ti mer must count four internal cycles (t cyc ), this is the limiting minimum factor in determining the timer resolution. t resl t th , t tl t tltl 4.0 125 (3) 3. the minimum period t tltl should not be less than the number of cycle times it takes to execute the capture interrupt service routine plus 24 t cyc . ? ? ? t cyc ns t cyc interrupt pulse width low (edge-triggered) t ilih 250 ? ns interrupt pulse period t ilil (4) 4. the minimum t ilil should not be less than the number of cycle times it takes to execute the interrupt service routine plus 19 t cyc . ? t cyc osc1 pulse width t oh ,t ol 200 ? ns t tltl * tcap pin t th * t tl * * refer to timer resolution data in 12.7 5.0-vdc control timing and 12.8 3.3-vdc control timing .
electrical specifications mc68hc05c9a advance informati on data sheet, rev. 4.1 100 freescale semiconductor figure 12-5. external interrupt timing figure 12-6. stop recovery timing diagram irq t ilih t ilil t ilih irq pin irq 1 irq n . . . a. edge-sensitive tr igger condition . the minimum pulse width (t ilih ) is either 125 ns (f op = 2.1 mhz) or 250 ns (f op = 1 mhz). the period t ilil should not be less than the number of t cyc cycles it takes to execute the interrupt service routine plus 19 t cyc cycles. b. level-sensitive trigger condition . if after servicing an interrupt the irq remains low, (internal) normally used with wired-or connection the next interrupt is recognized t ilih 4064 t cyc osc (1) t rl reset irq (2) irq (3) internal clock notes: 1. represents the internal clocking of the osc1 pin 2. irq pin edge-sensitive mask option 3. irq pin level- and edge-sensitive mask option 4. reset vector address shown for timing example reset or interrupt vector fetch 3ffe 3ffe 3ffe 3ffe 3ffe 3fff4
3.3-vdc control timing mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 101 figure 12-7. power-on reset timing diagram figure 12-8. external reset timing 3ffe 4064 t cyc v dd osc1 pin (2) internal clock (3) internal data bus (3) 3ffe 3ffe 3ffe 3ffe 3ffe 3fff (note 1) 1. power-on reset threshold is typically between 1 v and 2 v. 3. internal clock, internal address bus, and internal data bus are not available externally. new pch new pcl 2. osc1 line is meant to represent time only, not frequency. 4. reset outputs v ol during 4064 por cycles. notes: reset pin (note 4) internal address bus (3) internal clock (1) internal address bus (1) notes: internal data bus (1) 3ffe 3ffe 3fff new pc 1. internal clock, internal address bus, and internal data bus are not available externally. 2. the next rising edge of the internal clock after the rising edge of reset initiates the reset sequence. new pch t rl new pcl op code reset (2) 3ffe 3ffe
electrical specifications mc68hc05c9a advance informati on data sheet, rev. 4.1 102 freescale semiconductor 12.9 5.0-vdc serial peripheral interface timing no. characteristic (1) 1. v dd = 5.0 vdc 10%; v ss = 0 vdc, t a = ?40 to +85 c, unless otherwise noted. refer to figure 12-9 and figure 12-10 . symbol min max unit operating frequency master slave f op ( m ) f op ( s ) dc dc 0.5 2.1 f op mhz 1 cycle time master slave t cyc ( m ) t cyc ( s ) 2.0 480 ? ? t cyc ns 2 enable lead time master slave t lead ( m ) t lead ( s ) (2) 240 ? ? ns 3 enable lag time master slave t lag ( m ) t lag ( s ) (2) 720 2. signal production depends on software. ? ? ns 4 clock (sck) high time master slave t w ( sckh ) m t w ( sckh ) s 340 190 ? ? ns 5 clock (sck) low time master slave t w ( sckl ) m t w ( sckl ) s 340 190 ? ? ns 6 data setup time (inputs) master slave t su ( m ) t su ( s ) 100 100 ? ? ns 7 data hold time (inputs) master slave t h ( m ) t h ( s ) 100 100 ? ? ns 8 slave access time (time to data active from high-impedance state) t a 0 120 ns 9 slave disable time (hold time to high-impedance state) t dis ? 240 ns 10 data valid master (before capture edge) slave (after enable edge) (3) 3. assumes 200 pf load on all spi pins. t v ( m ) t v ( s ) 0.25 ? ? 240 t cyc ( m ) ns 11 data hold time (outputs) master (after capture edge) slave (after enable edge) t ho ( m ) t ho ( s ) 0.25 0 ? ? t cyc ( m ) ns 12 rise time (20% v dd to 70% v dd , c l = 200 pf) spi outputs (sck, mosi, and miso) spi inputs (sck, mosi, miso, and ss ) t rm t rs ? ? 100 2.0 ns s 13 fall time (70% v dd to 20% v dd , c l = 200 pf) spi outputs (sck, mosi, and miso) spi inputs (sck, mosi, miso, and ss ) t fm t fs ? ? 100 2.0 ns s
3.3- vdc serial peirpheral interface timing mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 103 12.10 3.3- vdc serial peirpheral interface timing no. characteristic (1) 1. v dd = 3.3 vdc 0.3 vdc; v ss = 0 vdc, t a = ?40 to +85 c, unless otherwise noted. refer to figure 12-9 and figure 12-10 . symbol min max unit operating frequency master slave f op ( m ) f op ( s ) dc dc 0.5 1.0 f op mhz 1 cycle time master slave t cyc ( m ) t cyc ( s ) 2.0 1.0 ? ? t cyc s 2 enable lead time master slave t lead ( m ) t lead ( s ) (2) 500 2. signal production depends on software. ? ? ns 3 enable lag time master slave t lag ( m ) t lag ( s ) (2) 1.5 ? ? ns s 4 clock (sck) high time master slave t w ( sckh ) m t w ( sckh ) s 720 400 ? ? ns 5 clock (sck) low time master slave t w ( sckl ) m t w ( sckl ) s 720 400 ? ? ns 6 data setup time (inputs) master slave t su ( m ) t su ( s ) 200 200 ? ? ns 7 data hold time (inputs) master slave t h ( m ) t h ( s ) 200 200 ? ? ns 8 slave access time (time to data active from high-impedance state) t a 0 250 ns 9 slave disable time (hold time to high-impedance state) t dis ? 500 ns 10 data valid master (before capture edge) slave (after enable edge) (3) 3. assumes 200 pf load on all spi pins. t v ( m ) t v ( s ) 0.25 ? ? 500 t cyc ( m ) ns 11 data hold time (outputs) master (after capture edge) slave (after enable edge) t ho ( m ) t ho ( s ) 0.25 0 ? ? t cyc ( m ) ns 12 rise time (20% v dd to 70% v dd , c l = 200 pf) spi outputs (sck, mosi, and miso) spi inputs (sck, mosi, miso, and ss ) t rm t rs ? ? 200 2.0 ns s 13 fall time (70% v dd to 20% v dd , c l = 200 pf) spi outputs (sck, mosi, and miso) spi inputs (sck, mosi, miso, and ss ) t fm t fs ? ? 200 2.0 ns s
electrical specifications mc68hc05c9a advance informati on data sheet, rev. 4.1 104 freescale semiconductor figure 12-9. spi master timing diagram note note: ss pin of master held high. msb in ss (input) sck (cpol = 0) (output) sck (cpol = 1) (output) miso (input) mosi (output) note 4 5 5 1 13 12 4 12 13 bit 6?1 lsb in master msb out bit 6?1 master lsb out 10 (ref) 13 11 10 12 11 (ref) 7 6 note note: ss pin of master held high. msb in ss (input) sck (cpol = 0) (output) sck (cpol = 1) (output) miso (input) mosi (output) note 4 5 5 1 13 12 4 13 bit 6?1 lsb in master msb out bit 6?1 master lsb out 10 (ref) 13 11 10 12 11 7 6 12 a) spi master timing (cpha = 0) b) spi master timing (cpha = 1) 12 this first clock edge is generated inter nally, but is not seen at the sck pin. this last clock edge is generated internally, but is not seen at the sck pin.
3.3- vdc serial peirpheral interface timing mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 105 figure 12-10. spi slave timing diagram note: slave ss (input) sck (cpol = 0) (input) sck (cpol = 1) (input) miso (output) mosi (input) 4 5 5 1 13 12 4 13 msb in bit 6?1 8 6 10 11 11 12 note slave lsb out 9 3 lsb in 2 7 bit 6?1 msb out note: slave ss (input) sck (cpol = 0) (input) sck (cpol = 1) (input) miso (output) mosi (input) 4 5 5 1 13 12 4 13 msb in bit 6?1 8 6 10 11 12 note slave lsb out 9 3 lsb in 2 7 bit 6?1 msb out 10 a) spi slave ti ming (cpha = 0) b) spi slave ti ming (cpha = 1) not defined but normally msb of character just received. not defined but normally lsb of character previ ously transmitted.
electrical specifications mc68hc05c9a advance informati on data sheet, rev. 4.1 106 freescale semiconductor
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 107 chapter 13 mechanical specifications 13.1 introduction this section describes the dimensions of the plastic dual in-line package (dip), plastic shrink dual in-line package (sdip), plastic leaded chip carrier (p lcc), and quad flat pack (qfp) mcu packages. the following figures show the latest package drawings at the time of th is publication. to make sure that you have the latest package specifications, contact your local freescale sales office. 13.2 40-pin plastic dual in-l ine (dip) package (case 711-03) figure 13-1. 40-pin plastic dip package (case 711-03) 120 40 21 b a c seating plane d f g h k n m j l dim min max min max inches millimeters a 51.69 52.45 2.035 2.065 b 13.72 14.22 0.540 0.560 c 3.94 5.08 0.155 0.200 d 0.36 0.56 0.014 0.022 f 1.02 1.52 0.040 0.060 g 2.54 bsc 0.100 bsc h 1.65 2.16 0.065 0.085 j 0.20 0.38 0.008 0.015 k 2.92 3.43 0.115 0.135 l 15.24 bsc 0.600 bsc m 1 n 0.51 1.02 0.020 0.040 notes: 1. position tolerance of leads (d), shall bewithin 0.25 (0.010) at maximum material conditions, in relation to seating plane and each other. 2. dimension l to center of leads when formed parallel. 3. dimension b does not include mold flash. 1 0 0
mechanical specifications mc68hc05c9a advance informati on data sheet, rev. 4.1 108 freescale semiconductor 13.3 42-pin plastic shrink dual in-line (sdip) pa ckage (case 858-01) figure 13-2. 42-pin plastic sdip package (case 858-01)                     
    
      
          -b- -a- c d 42 pl f k g n j 42 pl m      
          
  h l 
  
 
                                            !  "  !         #  !  $#  !   121 42 22   
 -t-
44-lead plastic leaded chip carrier (plcc) (case 777-02) mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 109 13.4 44-lead plastic leaded ch ip carrier (plcc) (case 777-02) figure 13-3. 44-lead plcc (case 777-02) -n- -l- -m- d y d k v w 1 44 brk b z u x view d-d s l-m m 0.007(0.180) n s t s l-m m 0.007(0.180) n s t g1 s l-m s 0.010 (0.25) n s t k1 f h s l-m m 0.007(0.180) n s t z g g1 r a e j view s c s l-m m 0.007(0.180) n s t s l-m m 0.007(0.180) n s t 0.004 (0.10) -t- seating plane view s dim min max min max millimeters inches a 0.685 0.695 17.40 17.65 b 0.685 0.695 17.40 17.65 c 0.165 0.180 4.20 4.57 e 0.090 0.110 2.29 2.79 f 0.013 0.019 0.33 0.48 g 0.050 bsc 1.27 bsc h 0.026 0.032 0.66 0.81 j 0.020 0.51 k 0.025 0.64 r 0.650 0.656 16.51 16.66 u 0.650 0.656 16.51 16.66 v 0.042 0.048 1.07 1.21 w 0.042 0.048 1.07 1.21 x 0.042 0.056 1.07 1.42 y 0.020 0.50 z 2 10 g1 0.610 0.630 15.50 16.00 k1 0.040 1.02 s l-m s 0.010 (0.25) n s t s l-m m 0.007(0.180) n s t 2 10 notes: 1. datums -l-, -m-, and -n- are determined where top of lead sholders exits plastic body at mold parting line. 2. dimension g1, true position to be measured at datum -t-, seating plane. 3. dimension r and u do not include mold flash. allowable mold flash is 0.010 (0.25) per side. 4. dimensioning and tolerancing per ansi y14.5m, 1982. 5. controlling dimension: inch. 6. the package top may be smaller than the package bottom by up to 0.012 (0.300). dimensions r and u are deter- mined at the outermost extremes of the plastic body exclusive of the mold flash, tie bar burrs, gate burrs and interlead flash, but including any mismatch between the top and bottom of the plastic body. 7. diminsion h does not include dambar protrusion or intrusion. the dambar protusion(s) shall not cause the h diminsion to be greater than 0.037 (0.940110). the dambar intrusion(s) shall not cause the h diminision to smaller than 0.025 (0.635).
mechanical specifications mc68hc05c9a advance informati on data sheet, rev. 4.1 110 freescale semiconductor 13.5 44-lead quad flat pack (qfp) (c ase 824a-01) figure 13-4. 44-lead qfp (case 824a-01)     
       !   !    !  !   l -d- bv a s m c h   
 -c- g m -h-   
 -a- l detail a 33 23 34 44 22 12 111 -b- e b b -a,b,d- -h- j k m w d f n r t q base metal x section b?b detail a detail c   
         
               %                          

  % %  %       
 %                      
 

  % %  %                    #  & &     !     "    "     $          !      # && & &  &&     #  & &     '       &&        #  #  "  #            #        #  & &
      #   #  "    #        $ !       $#           " #    !    (     (      (  (    )  (  ) (  ) (   detail c
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 111 chapter 14 ordering information 14.1 introduction this section contains ordering inform ation for the available package types. 14.2 mc order numbers table 14-1 shows the mc order numbers fo r the available package types. table 14-1. mc order numbers package type temperature range order number 40-pin plastic dual in-line package (dip) ?40c to 85c mc68hc705c9acp 42-pin shrink dual in-line package (sdip) ?40c to 85c mc68hc705c9acb 44-lead plastic leaded chip carrier (plcc) ?40c to 85c mc68hc705c9acfn 44-pin quad flat pack (qfp) ?40c to 85c mc68hc705c9acfb p = plastic dual in-line package (pdip) b = shrink dual in-line package (sdip) fn = plastic-leaded chip carrier (plcc) fb = quad flat pack (qfp)
ordering information mc68hc05c9a advance informati on data sheet, rev. 4.1 112 freescale semiconductor
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 113 appendix a eprom programming a.1 introduction this section describes programming of the eprom. a.2 bootloader mode bootloader mode is entered upon the rising edge of reset if the irq is at v tst and the tcap pin is at logic one. the bootloader code resides in the rom from $3f00 to $3fef. this program handles copying of user code from an external eprom into the on- chip eprom. the bootload function does not have to be done from an external eprom, but it may be done from a host. the user code must be a one-to-one corres pondence with the internal eprom addresses. a.3 bootloader functions three pins are used to select va rious bootloader functions: pd5, pd4, and pd3. two other pins, pc6 and pc7, are used to drive the prog led and the ver f led, respectively. the programming modes are shown in table a-2 . table a-1. operating modes reset irq tcap mode v ss to v dd v tst v ss to v dd v dd user bootloader table a-2. bootloader functions pd5 pd4 pd3 mode 0 0 0 program/verify 0 0 1 verify only 0 1 0 load ram and execute 1 x x secure
eprom programming mc68hc05c9a advance informati on data sheet, rev. 4.1 114 freescale semiconductor a.4 programming register (prog) this register is used to program the eprom array. to program a byte of eprom, set latch, write data to the desired address, and set epgm for t epgm . latch ? eprom latch control bit this read/write bit controls the latching of the address and data buses when programming the eprom. 1 = address and data buses latched when the follow ing instruction is a write to 1 of the eprom locations. normal reading is disabled if latch = 1. 0 = eprom address and data bus configured for normal reading epgm ? eprom program control bit this read/write bit controls whether the progra mming voltage is applied to the eprom array. for programming, this bit can be set only if the latch bit has been set previously. both epgm and latch cannot be set in the single write. 1 = programming voltage applied to eprom array 0 = programming voltage not applied to eprom array note bits 7?3 and bit 1 must be set to 0 when writing to the eprom programming register. $001xbit 7654321bit 0 read: latch epgm write: reset:00000000 figure a-1. eprom programming register
mc68hc05c9a advance informati on data sheet, rev. 4.1 freescale semiconductor 115 appendix b m68hc05cx family feature comparisons refer to table b-1 for a comparison of the features for all the m68hc05c family members.
mc68hc05c9a advance information data sheet, rev. 4.1 116 freescale semiconductor m68hc05cx family feature comparisons table b-1. m68hc05cx feature comparison c4 c4a 705c4a c8 c8a 705c8 705c8a c12 c12a c9 c9a/c9e 705c9 705c9a user rom 4160 4160 ? 7744 7744 ? ? 12,096 12,096 15,760?15,936 15,760?15,936 ? ? user eprom ? ? 4160 ? ? 7596?7740 7596?7740 ? ? ? ? 15,760?15,936 12,096?15,936 code security no yes yes no yes yes yes no yes no yes no yes ram 176 176 176 176 176 176?304 176?304 176 176 176?352 176?352 176?352 176?352 option register (irq/ram/ sec) no no $1fdf (irq/sec) no no $1fdf (irq/ram/ sec) $1fdf (irq/ram/sec) no no $3fdf (irq/ram) $3fdf (irq/ram) $3fdf (irq/ram) $3fdf (irq/ram) mask option register(s) no no $1ff0?$1ff1 no no no $1ff0?$1ff1 no no no no no $3ff0?$3ff1 portb keyscan (pullup/ interrupt) no yes mask option yes mor select- able no yes mask option no yes mor selectable yes mask option yes mask option no yes mask option no yes mor selectable pc7 drive standard high current high current standard high current standard high current high current high current standard high current standard high current port d pd7, 5?0 input only pd7, 5?0 input only pd7, 5?0 input only pd7, 5?0 input only pd7, 5?0 input only pd7, 5?0 input only pd7, 5?0 input only pd7, 5?0 input only pd7, 5?0 input only pd7, 5?0 bidirec- tional pd7, 5?0 bidirectional pd7, 5?0 bidirectional pd7, 5?0 bidirectional cop no yes yes no yes yes two types yes yes yes yes yes two types cop enable ? mask option mor ? mask option software software+ mor mask option mask option software software software software+ mor cop timeout ? 64 ms (@4 mhz osc) 64 ms (@4 mhz osc) ? 64 ms (@4 mhz osc) software selectable software+ mor selectable 64 ms (@4 mhz osc) 64 ms (@4mhz osc) software selectable software selectable software selectable software+ mor selectable cop clear ? clr $1ff0 clr $1ff0 ? clr $1ff0 write $55/$aa to $001d write $55/$aa to $001d or clr $1ff0 clr $3ff0 clr $3ff0 write $55/$aa to $001d write $55/$aa to $001d write $55/$aa to $001d write $55/$aa to $001d or clr $3ff0 clock monitor no no no no no yes yes no no yes yes yes yes (c9a mode) active reset no no no no no cop/clock monitor program- mable cop/clock monitor no no por/cop/ clock monitor por/cop/ clock monitor por/cop/ clock monitor por/c9a cop/ clock monitor stop disable no mask option no no mask option no no mask option mask option no no no mor selectable (c12a mode) notes: 1. the expanded ram map (from $30?$4f and $100?$15f) available on the ot p devices mc68hc705c8 and mc 68hc705c8a is not available on the rom devices mc68hc05c8 and mc68hc05c8a. 2. the programmable cop available on the mc68hc705c8 and mc68hc705c8a is not available on the mc68hc05c8a. for rom compatibility , use the non-programmable cop.
blank
how to reach us: home page: www.freescale.com e-mail: support@freescale.com usa/europe or locations not listed: freescale semiconductor technical information center, ch370 1300 n. alma school road chandler, arizona 85224 +1-800-521-6274 or +1-480-768-2130 support@freescale.com europe, middle east, and africa: freescale halbleiter deutschland gmbh technical information center schatzbogen 7 81829 muenchen, germany +44 1296 380 456 (english) +46 8 52200080 (english) +49 89 92103 559 (german) +33 1 69 35 48 48 (french) support@freescale.com japan: freescale semiconductor japan ltd. headquarters arco tower 15f 1-8-1, shimo-meguro, meguro-ku, tokyo 153-0064 japan 0120 191014 or +81 3 5437 9125 support.japan@freescale.com asia/pacific: freescale semiconductor hong kong ltd. technical information center 2 dai king street tai po industrial estate tai po, n.t., hong kong +800 2666 8080 support.asia@freescale.com for literature requests only: freescale semiconductor lite rature distribution center p.o. box 5405 denver, colorado 80217 1-800-441-2447 or 303-675-2140 fax: 303-675-2150 ldcforfreescalesemiconductor@hibbertgroup.com information in this document is provided solely to enable system and software implementers to use freescale semiconduc tor products. there are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. freescale semiconductor reserves the right to make changes without further notice to any products herein. freescale semiconductor makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does freescale semiconductor assume any liability ar ising out of the application or use of any product or circuit, and specifically discl aims any and all liability, including without limitation consequential or incidental damages. ?typical? parameters that may be provided in freescale semiconductor data s heets and/or specifications can and do vary in different applications and actual performance may vary over time. all operating parameters, including ?typicals?, must be validated for each customer application by customer?s technical experts. freescale se miconductor does not convey any license under its patent rights nor the rights of others. freescale semiconductor products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the fa ilure of the freescale semiconductor product could create a situation where personal injury or death may occur. should buyer purchase or use freescale semiconductor products for any such unintended or unauthorized application, buyer shall indemni fy and hold freescale semiconductor and its officers, employees, subsidiaries, affili ates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that freescale semiconductor was negligent regarding the design or manufacture of the part. freescale? and the freescale logo are trademarks of freescale semiconductor, inc. all other product or service names are the property of their respective owners. ? freescale semiconductor, inc. 2005. all rights reserved. mc68hc705c9a rev. 4.1, 9/2005


▲Up To Search▲   

 
Price & Availability of MC705C9ACPE

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X